Rep Personal Dim, ajuste columnas y descarga txt
This commit is contained in:
@@ -1030,6 +1030,24 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
Becas para<br /> trabajadores<br />(Gravado)
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblP046G" runat="server" Text='<%# Eval("P046G") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
Becas para<br /> trabajadores<br />(Exento)
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblP046E" runat="server" Text='<%# Eval("P046E") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
@@ -1096,22 +1114,7 @@
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblSumaIngresoE" runat="server" Text='<%# Eval("SumaIngresoE") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>P046G</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblP046G" runat="server" Text='<%# Eval("P046G") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>P046E</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblP046E" runat="server" Text='<%# Eval("P046E") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports CrystalDecisions.CrystalReports.Engine
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
@@ -122,28 +123,39 @@ Partial Class Nomina_RepPersonalDIM
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ConvertirTablaATexto(ByVal tabla As DataTable) As String
|
||||
Public Function ConvertirTablaATexto(ByVal DT As DataTable) As String
|
||||
|
||||
'Dim sb As New StringBuilder()
|
||||
'For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
' For Each GvCell As TableCell In GvRow.Cells
|
||||
' sb.Append(GvCell.ID & "|")
|
||||
' Next
|
||||
' sb.AppendLine()
|
||||
'Next
|
||||
'Return sb.ToString()
|
||||
Dim DTDatos As DataTable = DT.Copy()
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
For Each gvRow As GridViewRow In GvDatos.Rows
|
||||
For Each gvCell As TableCell In gvRow.Cells
|
||||
Dim columnIndex As Integer = gvRow.Cells.GetCellIndex(gvCell)
|
||||
Dim rowIndex As Integer = gvRow.RowIndex
|
||||
Dim cellID As String = "cell_" & rowIndex.ToString() & "_" & columnIndex.ToString()
|
||||
sb.Append(gvRow.Cells(columnIndex).Controls(0).ClientID & "|")
|
||||
Dim columnasARemover As New List(Of DataColumn)()
|
||||
|
||||
|
||||
For Each columna As DataColumn In DTDatos.Columns
|
||||
If columna.ColumnName.Contains("CvePersonal") Then
|
||||
columnasARemover.Add(columna)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
For Each columna As DataColumn In columnasARemover
|
||||
DTDatos.Columns.Remove(columna)
|
||||
Next
|
||||
|
||||
DTDatos.AcceptChanges()
|
||||
|
||||
Dim sb As New StringBuilder
|
||||
For Each fila As DataRow In DTDatos.Rows
|
||||
For i As Integer = 0 To DTDatos.Columns.Count - 1
|
||||
sb.Append(fila(i).ToString())
|
||||
|
||||
If i < DTDatos.Columns.Count - 1 Then
|
||||
sb.Append("|")
|
||||
End If
|
||||
Next
|
||||
sb.AppendLine()
|
||||
Next
|
||||
Return sb.ToString()
|
||||
|
||||
Return sb.tostring
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user