- excel personalizado
This commit is contained in:
@@ -62,6 +62,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-file-excel-o"></i> Excel Personalizado</asp:LinkButton>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
|
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
@@ -85,7 +88,9 @@
|
|||||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||||
<asp:PostBackTrigger ControlID="LnkDescargarSegmentos" />
|
<asp:PostBackTrigger ControlID="LnkDescargarSegmentos" />
|
||||||
|
<asp:PostBackTrigger ControlID="ImgExcelPersonalizado" />
|
||||||
</Triggers>
|
</Triggers>
|
||||||
|
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Option Strict On
|
|||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports DocumentFormat.OpenXml.VariantTypes
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
@@ -19,7 +20,14 @@ Partial Class RepCxC
|
|||||||
ViewState("DtDatos") = value
|
ViewState("DtDatos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Public Property SePersonalizo() As Integer
|
||||||
|
Get
|
||||||
|
Return ViewState("SePersonalizo").ToString.ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("SePersonalizo") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Private Property DtPersonalizarRango As DataTable
|
Private Property DtPersonalizarRango As DataTable
|
||||||
Get
|
Get
|
||||||
DtPersonalizarRango = DirectCast(ViewState("DtPersonalizarRango"), DataTable)
|
DtPersonalizarRango = DirectCast(ViewState("DtPersonalizarRango"), DataTable)
|
||||||
@@ -96,6 +104,7 @@ Partial Class RepCxC
|
|||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
Index = 0
|
Index = 0
|
||||||
Modalidad = ""
|
Modalidad = ""
|
||||||
|
SePersonalizo = 0
|
||||||
CargaCombos()
|
CargaCombos()
|
||||||
CargaGvPersonalizarRangoColumnas()
|
CargaGvPersonalizarRangoColumnas()
|
||||||
ProcesaRequest()
|
ProcesaRequest()
|
||||||
@@ -127,7 +136,6 @@ Partial Class RepCxC
|
|||||||
itemTipoDocto.Selected = (tipoDocto.ToUpper = itemTipoDocto.Value.ToUpper)
|
itemTipoDocto.Selected = (tipoDocto.ToUpper = itemTipoDocto.Value.ToUpper)
|
||||||
Next
|
Next
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero <> 0 Then
|
If Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero <> 0 Then
|
||||||
@@ -138,7 +146,6 @@ Partial Class RepCxC
|
|||||||
DdlSubProyecto.SelectedValueExist(Request("CveSubProyecto").ToEntero)
|
DdlSubProyecto.SelectedValueExist(Request("CveSubProyecto").ToEntero)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
@@ -202,10 +209,9 @@ Partial Class RepCxC
|
|||||||
DdlContrato.DataSource = ObjContratos.DtResultados
|
DdlContrato.DataSource = ObjContratos.DtResultados
|
||||||
End If
|
End If
|
||||||
divContrato.Visible = True
|
divContrato.Visible = True
|
||||||
divContrato1.visible = True
|
divContrato1.Visible = True
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
DdlContrato.DataBind()
|
DdlContrato.DataBind()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
@@ -229,7 +235,7 @@ Partial Class RepCxC
|
|||||||
CveCobranzaEstatus = DdlCobranzaEstatus.SelectedValue.ToEntero
|
CveCobranzaEstatus = DdlCobranzaEstatus.SelectedValue.ToEntero
|
||||||
CveClienteClasificacion = DdlClienteClasificacion.SelectedValue.ToEntero
|
CveClienteClasificacion = DdlClienteClasificacion.SelectedValue.ToEntero
|
||||||
Dim CveCliente As Integer = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1)
|
Dim CveCliente As Integer = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1)
|
||||||
Dim AplicaAnticipos As Integer = If(ChkAnticipos.checked, 1, 0)
|
Dim AplicaAnticipos As Integer = If(ChkAnticipos.Checked, 1, 0)
|
||||||
|
|
||||||
|
|
||||||
If ObjMovtos.GetCxC(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
|
If ObjMovtos.GetCxC(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
|
||||||
@@ -645,6 +651,7 @@ Partial Class RepCxC
|
|||||||
GvDatos.Columns(16).Visible = True
|
GvDatos.Columns(16).Visible = True
|
||||||
GvDatos.Columns(17).Visible = True
|
GvDatos.Columns(17).Visible = True
|
||||||
GvDatos.Columns(18).Visible = True
|
GvDatos.Columns(18).Visible = True
|
||||||
|
SePersonalizo = 1
|
||||||
Else
|
Else
|
||||||
GvDatos.Columns(14).Visible = False
|
GvDatos.Columns(14).Visible = False
|
||||||
GvDatos.Columns(15).Visible = False
|
GvDatos.Columns(15).Visible = False
|
||||||
@@ -653,15 +660,30 @@ Partial Class RepCxC
|
|||||||
GvDatos.Columns(18).Visible = False
|
GvDatos.Columns(18).Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GvDatos.Columns(1).Visible = ChkCodigoCl.Checked
|
ActivaColumna(1, ChkCodigoCl.Checked)
|
||||||
GvDatos.Columns(2).Visible = ChkNombreCorto.Checked
|
ActivaColumna(2, ChkNombreCorto.Checked)
|
||||||
GvDatos.Columns(19).Visible = ChkSubTotalP.Checked
|
ActivaColumna(19, ChkSubTotalP.Checked)
|
||||||
GvDatos.Columns(20).Visible = ChkIVAP.Checked
|
ActivaColumna(20, ChkIVAP.Checked)
|
||||||
GvDatos.Columns(21).Visible = ChkIEPSP.Checked
|
ActivaColumna(21, ChkIEPSP.Checked)
|
||||||
|
|
||||||
|
If SePersonalizo = 1 Then
|
||||||
|
ImgExcelPersonalizado.Visible = True
|
||||||
|
Else
|
||||||
|
ImgExcelPersonalizado.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ActivaColumna(Indice As Integer, Activo As Boolean)
|
||||||
|
|
||||||
|
If Activo Then
|
||||||
|
GvDatos.Columns(Indice).Visible = True
|
||||||
|
SePersonalizo = 1
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "IMPRESIONES"
|
#Region "IMPRESIONES"
|
||||||
@@ -966,12 +988,12 @@ Partial Class RepCxC
|
|||||||
Dim ObjSMS As New ClsTecnoMovil
|
Dim ObjSMS As New ClsTecnoMovil
|
||||||
Dim ObjEventos As New ClsOIEventos
|
Dim ObjEventos As New ClsOIEventos
|
||||||
|
|
||||||
Dim Pesos = 0.0
|
Dim Pesos As Decimal = 0
|
||||||
Dim Dolares = 0.0
|
Dim Dolares As Decimal = 0
|
||||||
Dim Telefono As String = ""
|
Dim Telefono As String = ""
|
||||||
Dim Mensaje As String = ""
|
Dim Mensaje As String = ""
|
||||||
Dim StrSaldo As String = ""
|
Dim StrSaldo As String = ""
|
||||||
Dim Contador = 0
|
Dim Contador As Integer = 0
|
||||||
|
|
||||||
'Dim sw As New System.Diagnostics.Stopwatch()
|
'Dim sw As New System.Diagnostics.Stopwatch()
|
||||||
'sw.Start()
|
'sw.Start()
|
||||||
@@ -984,8 +1006,8 @@ Partial Class RepCxC
|
|||||||
Telefono = Dr("CobranzaTelefono").ToString
|
Telefono = Dr("CobranzaTelefono").ToString
|
||||||
|
|
||||||
If Telefono.Length = 10 Then
|
If Telefono.Length = 10 Then
|
||||||
Pesos = If(Dr("CveMoneda").ToString.ToEntero = 1, Dr("Saldo").ToString.ToDouble, 0)
|
Pesos = If(Dr("CveMoneda").ToString.ToEntero = 1, Dr("Saldo").ToString.ToDecimal, 0)
|
||||||
Dolares = If(Dr("CveMoneda").ToString.ToEntero = 2, Dr("Saldo").ToString.ToDouble, 0)
|
Dolares = If(Dr("CveMoneda").ToString.ToEntero = 2, Dr("Saldo").ToString.ToDecimal, 0)
|
||||||
|
|
||||||
If Pesos > 0 Then StrSaldo = $" ${Pesos.FormatoNumero} pesos"
|
If Pesos > 0 Then StrSaldo = $" ${Pesos.FormatoNumero} pesos"
|
||||||
If Dolares > 0 Then StrSaldo = $" ${Mensaje} ${Dolares.FormatoNumero} dólares"
|
If Dolares > 0 Then StrSaldo = $" ${Mensaje} ${Dolares.FormatoNumero} dólares"
|
||||||
@@ -1019,11 +1041,11 @@ Partial Class RepCxC
|
|||||||
Protected Sub LBEnviarCorreo_Click(sender As Object, e As EventArgs)
|
Protected Sub LBEnviarCorreo_Click(sender As Object, e As EventArgs)
|
||||||
Dim ObjEventos As New ClsOIEventos
|
Dim ObjEventos As New ClsOIEventos
|
||||||
|
|
||||||
Dim Pesos = 0.0
|
Dim Pesos As Decimal = 0
|
||||||
Dim Dolares = 0.0
|
Dim Dolares As Decimal = 0
|
||||||
Dim Correo As String = ""
|
Dim Correo As String = ""
|
||||||
Dim Mensaje As String = ""
|
Dim Mensaje As String = ""
|
||||||
Dim Contador = 0
|
Dim Contador As Integer = 0
|
||||||
|
|
||||||
'Dim sw As New System.Diagnostics.Stopwatch()
|
'Dim sw As New System.Diagnostics.Stopwatch()
|
||||||
'sw.Start()
|
'sw.Start()
|
||||||
@@ -1035,8 +1057,8 @@ Partial Class RepCxC
|
|||||||
Correo = Dr("CobranzaCorreo").ToString
|
Correo = Dr("CobranzaCorreo").ToString
|
||||||
|
|
||||||
If Correo.Length > 0 Then
|
If Correo.Length > 0 Then
|
||||||
Pesos = If(Dr("CveMoneda").ToString.ToEntero = 1, Dr("Saldo").ToString.ToDouble, 0)
|
Pesos = If(Dr("CveMoneda").ToString.ToEntero = 1, Dr("Saldo").ToString.ToDecimal, 0)
|
||||||
Dolares = If(Dr("CveMoneda").ToString.ToEntero = 2, Dr("Saldo").ToString.ToDouble, 0)
|
Dolares = If(Dr("CveMoneda").ToString.ToEntero = 2, Dr("Saldo").ToString.ToDecimal, 0)
|
||||||
|
|
||||||
If Pesos > 0 Then Mensaje = $" ${Pesos.FormatoNumero} pesos"
|
If Pesos > 0 Then Mensaje = $" ${Pesos.FormatoNumero} pesos"
|
||||||
If Dolares > 0 Then Mensaje = $" {Mensaje} ${Dolares.FormatoNumero} dólares"
|
If Dolares > 0 Then Mensaje = $" {Mensaje} ${Dolares.FormatoNumero} dólares"
|
||||||
@@ -1346,7 +1368,7 @@ Partial Class RepCxC
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
Dim Dr1 As DataRow = DtGrafica.Rows(0)
|
Dim Dr1 As DataRow = DtGrafica.Rows(0)
|
||||||
For Cont = 1 To 8
|
For Cont As Integer = 1 To 8
|
||||||
If Dr1($"TC{Cont}").ToString.ToEntero = Tipo And Not Dr1($"NomC{Cont}").ToString = "Total" Then
|
If Dr1($"TC{Cont}").ToString.ToEntero = Tipo And Not Dr1($"NomC{Cont}").ToString = "Total" Then
|
||||||
Top = 1
|
Top = 1
|
||||||
Dim Row As DataRow = Dt5.NewRow()
|
Dim Row As DataRow = Dt5.NewRow()
|
||||||
@@ -1379,6 +1401,8 @@ Partial Class RepCxC
|
|||||||
CambioGrafica(DdlVer.SelectedValue.ToEntero)
|
CambioGrafica(DdlVer.SelectedValue.ToEntero)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -1399,5 +1423,27 @@ Partial Class RepCxC
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
Private Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
|
||||||
|
|
||||||
|
Dim Cliente As String = If(DdlClientesWS.SelectedValue = "-1", "", $" Cliente: {DdlClientesWS.SelectedText}")
|
||||||
|
Dim Sucursal As String = If(DdlSubProyecto.SelectedValue = "-1", "", $" Sucursal: {DdlSubProyecto.SelectedItem.Text}")
|
||||||
|
Dim Grupo As String = $" Agrupado Por: {DdlGrupo.SelectedItem.Text}" 'If(DdlGrupo.SelectedValue = "3", "", $" <b>Agrupado Por:</b> {DdlGrupo.SelectedItem.Text}")
|
||||||
|
Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedText = "", "", $" Documentos: {DdlTipoDocto.GetSelectedText}")
|
||||||
|
Dim Vendedor As String = If(DdlVendedor.SelectedValue = "-1", "", $" Vendedor: {DdlVendedor.SelectedItem.Text}")
|
||||||
|
Dim FechaIn As String = If(txtFechaI.Text = "", "", $" Fecha Inicio Docto: {txtFechaI.Text}")
|
||||||
|
Dim FechaFn As String = If(txtFechaF.Text = "", "", $" Fecha Fin Docto: {txtFechaF.Text}")
|
||||||
|
Dim FVI As String = If(txtFechaVI.Text = "", "", $" Fecha Venc. Inic.: {txtFechaVI.Text}")
|
||||||
|
Dim FVF As String = If(txtFechaVF.Text = "", "", $" Fecha Venc. Final: ;{txtFechaVF.Text}")
|
||||||
|
Dim Registro As String = If(DdlUsuario.SelectedValue = "-1", "", $" Registró: ;{DdlUsuario.SelectedItem.Text}")
|
||||||
|
Dim Responsable As String = If(DdlResponsable.SelectedValue = "-1", "", $" Responsable: ;{DdlResponsable.SelectedItem.Text}")
|
||||||
|
Dim CorteA As String = If(txtCorteA.Text = "31/12/2019", "", $"Corte A {txtCorteA.Text}")
|
||||||
|
Dim ClasificacionCli As String = If(DdlClienteClasificacion.SelectedValue = "-1", "", $" Clasificación Cliente: {DdlClienteClasificacion.SelectedItem.Text}")
|
||||||
|
|
||||||
|
Dim Filtro As String = $"{Cliente}{Sucursal}{Grupo}{Vendedor}{FechaIn}{FechaFn}{Registro}{Responsable}{TipoDocto}{FVI}{FVF}{ClasificacionCli}{CorteA}"
|
||||||
|
|
||||||
|
GvDatos.ExportToExcelGembox("ReporteCxC", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE", DatoTituloExtra:=$"", DatosFiltros:=Filtro)
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user