Rep PErsonal DIM Colo cabecera doble,txt busqueda

This commit is contained in:
Oscar Irigoyen
2023-06-23 13:01:12 -07:00
parent 65d418dd2d
commit 9f163cf420
2 changed files with 109 additions and 9 deletions

View File

@@ -28,7 +28,11 @@
th{
text-align:left!important;
border-top-style:none!important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
@@ -90,14 +94,22 @@
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpGvCargaDatos" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" DataKeyNames="" ShowHeaderWhenEmpty="true" OnDataBound="GvDatos_DataBound"
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn"
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" DataKeyNames="" ShowHeaderWhenEmpty="true" OnDataBound="GvDatos_DataBound" data-freezerows="2"
CssClass="table table-hover ScrollAD mysmallbtn"
Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>

View File

@@ -8,10 +8,43 @@ Imports CrystalDecisions.CrystalReports.Engine
Imports Extensiones
Imports GemBox.Spreadsheet
Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Report.Export
Partial Class Nomina_RepPersonalDIM
Inherits ClsPaginas
ReadOnly Property color_green_dark As Drawing.Color
Get
Return System.Drawing.Color.FromArgb(77, 179, 162)
End Get
End Property
ReadOnly Property color_purple_intense As Drawing.Color
Get
Return System.Drawing.Color.FromArgb(135, 117, 167)
End Get
End Property
ReadOnly Property color_blue As Drawing.Color
Get
Return System.Drawing.Color.FromArgb(53, 152, 220)
End Get
End Property
ReadOnly Property color_blue_madison As Drawing.Color
Get
Return System.Drawing.Color.FromArgb(87, 142, 190)
End Get
End Property
ReadOnly Property color_yellow As Drawing.Color
Get
Return System.Drawing.Color.FromArgb(196, 159, 71)
End Get
End Property
Public Property Dt_Datos As DataTable
Get
If ViewState("Dt_Datos") Is Nothing Then
@@ -54,6 +87,8 @@ Partial Class Nomina_RepPersonalDIM
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
@@ -99,20 +134,57 @@ Partial Class Nomina_RepPersonalDIM
Imprimir("Excel")
End Sub
Private Sub Imprimir(Optional reporte As String = "PDF")
Private Sub ColoresCabeceraGrid()
Dim countColumnas As Integer = 0
For Each gvColumn As DataControlField In GvDatos.Columns
If countColumnas <= 27 Then
GvDatos.Columns(countColumnas).HeaderStyle.BackColor = color_green_dark
End If
If countColumnas > 27 And countColumnas <= 45 Then
GvDatos.Columns(countColumnas).HeaderStyle.BackColor = color_purple_intense
End If
If countColumnas > 45 And countColumnas <= 47 Then
GvDatos.Columns(countColumnas).HeaderStyle.BackColor = color_blue
End If
If countColumnas > 47 And countColumnas <= 105 Then
GvDatos.Columns(countColumnas).HeaderStyle.BackColor = color_blue_madison
End If
If countColumnas > 105 And countColumnas <= 124 Then
GvDatos.Columns(countColumnas).HeaderStyle.BackColor = color_yellow
End If
countColumnas = countColumnas + 1
Next
End Sub
Private Sub Imprimir(Optional reporte As String = "PDF")
ColoresCabeceraGrid()
Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
Dim cell As New TableHeaderCell()
cell.Text = "ANEXO 1 INFORMACION DEL EMPLEADO ->"
cell.ColumnSpan = 28
cell.HorizontalAlign = HorizontalAlign.Left
'cell.BackColor = Drawing.Color.FromArgb(77, 179, 162)
cell.BackColor = color_green_dark
row.Controls.Add(cell)
cell = New TableHeaderCell()
cell.ColumnSpan = 18
cell.Text = "ANEXO 1 PAGOS POR SEPARACION ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_purple_intense
row.Controls.Add(cell)
@@ -120,6 +192,7 @@ Partial Class Nomina_RepPersonalDIM
cell.ColumnSpan = 2
cell.Text = " ANEXO 1 ASIM SAL-> "
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_blue
row.Controls.Add(cell)
@@ -127,17 +200,21 @@ Partial Class Nomina_RepPersonalDIM
cell.ColumnSpan = 58
cell.Text = "ANEXO 1 PAGOS DEL PATRÓN EFECTUADOS A SUS TRABAJADORES ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_blue_madison
row.Controls.Add(cell)
cell = New TableHeaderCell()
cell.ColumnSpan = 19
cell.Text = "ANEXO 1 IMPUESTO SOBRE LA RENTA (RESUMEN) ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_yellow
row.Controls.Add(cell)
'row.BackColor = ColorTranslator.FromHtml("#3AC0F2")
GvDatos.HeaderRow.Parent.Controls.AddAt(0, row)
ExportToExcelGembox(GvDatos, "RepPersonalDIM", UsuarioActual, "Reporte Personal DIM", "", DatosFiltros:=$"Ejercicio {DdlEjercicio.SelectedItem.Text}")
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
@@ -187,11 +264,16 @@ Partial Class Nomina_RepPersonalDIM
Protected Sub GvDatos_DataBound(sender As Object, e As EventArgs)
ColoresCabeceraGrid()
Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
Dim cell As New TableHeaderCell()
cell.Text = "ANEXO 1 INFORMACION DEL EMPLEADO ->"
cell.ColumnSpan = 28
cell.HorizontalAlign = HorizontalAlign.Left
'cell.BackColor = Drawing.Color.FromArgb(77, 179, 162)
cell.BackColor = color_green_dark
row.Controls.Add(cell)
@@ -200,6 +282,7 @@ Partial Class Nomina_RepPersonalDIM
cell.ColumnSpan = 18
cell.Text = "ANEXO 1 PAGOS POR SEPARACION ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_purple_intense
row.Controls.Add(cell)
@@ -207,6 +290,7 @@ Partial Class Nomina_RepPersonalDIM
cell.ColumnSpan = 2
cell.Text = " ANEXO 1 ASIM SAL-> "
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_blue
row.Controls.Add(cell)
@@ -214,17 +298,19 @@ Partial Class Nomina_RepPersonalDIM
cell.ColumnSpan = 58
cell.Text = "ANEXO 1 PAGOS DEL PATRÓN EFECTUADOS A SUS TRABAJADORES ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_blue_madison
row.Controls.Add(cell)
cell = New TableHeaderCell()
cell.ColumnSpan = 19
cell.Text = "ANEXO 1 IMPUESTO SOBRE LA RENTA (RESUMEN) ->"
cell.HorizontalAlign = HorizontalAlign.Left
cell.BackColor = color_yellow
row.Controls.Add(cell)
'row.BackColor = ColorTranslator.FromHtml("#3AC0F2")
GvDatos.HeaderRow.Parent.Controls.AddAt(0, row)
End Sub
@@ -330,15 +416,15 @@ Partial Class Nomina_RepPersonalDIM
'worksheet.Rows(TotalRowHeader).Cells.GetSubrange("DC8:DS9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 140, 64), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("A8:AB9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(218, 247, 166), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("A8:AB9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(77, 179, 162), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AC8:AT9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(216, 191, 216), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AC8:AT9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(135, 117, 167), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AU8:AV9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(59, 131, 189), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AU8:AV9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(53, 152, 220), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AW8:DB9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(216, 191, 216), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("AW8:DB9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(87, 142, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("DC8:DU9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 140, 64), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells.GetSubrange("DC8:DU9").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(196, 159, 71), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Cells("DC8").Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 140, 64), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
@@ -498,3 +584,5 @@ Partial Class Nomina_RepPersonalDIM
End Sub
End Class
Friend Class GridViewColumn
End Class