Documetos parametros, Alamacenes, RepEstado resultados(General)
This commit is contained in:
@@ -3,7 +3,9 @@ Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
@@ -21,6 +23,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
ViewState("DtDatosMes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtIngresosMes As DataTable
|
||||
Get
|
||||
DtIngresosMes = DirectCast(ViewState("DtIngresosMes"), DataTable)
|
||||
@@ -291,6 +294,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
End If
|
||||
|
||||
If Tab.ActiveTabIndex = 2 Then
|
||||
ValidaEjercicios()
|
||||
|
||||
|
||||
LiSubProyectoDdl.Visible = True
|
||||
LiSubProyectoLbl.Visible = True
|
||||
@@ -326,6 +331,39 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
LiDivisorLbl.Visible = True
|
||||
End If
|
||||
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlEjercicio_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ValidaEjercicios()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlEjercicio2_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ValidaEjercicios()
|
||||
End Sub
|
||||
|
||||
Private Sub ValidaEjercicios()
|
||||
|
||||
|
||||
Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero
|
||||
|
||||
|
||||
If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then
|
||||
|
||||
If DdlEjercicio2.Items.Count > 0 Then
|
||||
DdlEjercicio2.SelectedIndex = DdlEjercicio2.Items.Count - 1
|
||||
End If
|
||||
|
||||
Dim Fejerciosio As Integer = DdlEjercicio2.SelectedValue.ToEntero
|
||||
|
||||
If Not EInicio + 1 > Fejerciosio Then
|
||||
DdlEjercicio2.SelectedValueExist(EInicio + 1)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
|
||||
@@ -366,6 +404,11 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
'AÑO HORIZONTAL
|
||||
If Tab.ActiveTabIndex = 2 Then
|
||||
|
||||
If DdlEjercicio.SelectedValue.ToEntero > DdlEjercicio2.SelectedValue.ToEntero Then
|
||||
Alert("El ejercicio inicio no debe ser mayor al ejercicio fin.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
CargaDatosAnualH()
|
||||
End If
|
||||
|
||||
@@ -478,12 +521,20 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
|
||||
|
||||
Private Sub SumaTotales()
|
||||
'Llena Lb´s Totales
|
||||
LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero
|
||||
|
||||
LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero
|
||||
|
||||
Private Sub SumaTotales()
|
||||
'Llena Lb´s Totales
|
||||
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 1 Then
|
||||
LbTotalActual.Text = TotalActualMes.ToString("###,###,##0")
|
||||
LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0")
|
||||
Else
|
||||
LbTotalActual.Text = TotalActualMes.ToString("###,###,##0.00")
|
||||
LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0.00")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black)
|
||||
|
||||
LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black)
|
||||
@@ -493,8 +544,10 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
#Region "GV´S ROW DATA BOUND"
|
||||
|
||||
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
|
||||
TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble
|
||||
TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
|
||||
@@ -507,10 +560,20 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 1 Then
|
||||
e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString
|
||||
Else
|
||||
e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
|
||||
@@ -540,6 +603,14 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
End If
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 1 Then
|
||||
e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString
|
||||
Else
|
||||
e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
|
||||
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
@@ -579,8 +650,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
ObjConta.Dispose()
|
||||
|
||||
If DtDatosMesH IsNot Nothing Then
|
||||
CargaGridsMesH()
|
||||
SumaTotalesMesH()
|
||||
CargaGridsMesH()
|
||||
Else
|
||||
|
||||
End If
|
||||
@@ -616,7 +686,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Row.Item("Noviembre") = DtIngresosMesH.SUM("Noviembre", "NOT CtaMayor in (3,4)")
|
||||
Row.Item("Diciembre") = DtIngresosMesH.SUM("Diciembre", "NOT CtaMayor in (3,4)")
|
||||
|
||||
Row.Item("Nombre") = "TOTAL INGRESOS "
|
||||
Row.Item("Nombre") = "TOTAL INGRESOS"
|
||||
Row.Item("ImporteActual") = TotalActual.ToString
|
||||
Row.Item("PorcentajeActual") = "100.00"
|
||||
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
|
||||
@@ -714,34 +784,25 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SumaTotalesMesH()
|
||||
''Llena Lb´s Totales
|
||||
''*********************************************************************************
|
||||
'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero
|
||||
'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero
|
||||
|
||||
'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black)
|
||||
'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvIngresosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
|
||||
TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble
|
||||
TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
|
||||
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
||||
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
||||
TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
|
||||
e.Row.ControlStyle.Font.Bold = True
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
||||
'e.Row.CssClass = "SubTotales3"
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
||||
e.Row.ControlStyle.Font.Bold = True
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
|
||||
|
||||
'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1"
|
||||
|
||||
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1"
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
@@ -759,14 +820,59 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
|
||||
' e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
|
||||
'End If
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL INGRESOS" Then
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 1 Then
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0")
|
||||
Else
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor)
|
||||
e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor)
|
||||
e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor)
|
||||
e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor)
|
||||
e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor)
|
||||
e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor)
|
||||
e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor)
|
||||
e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor)
|
||||
|
||||
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
|
||||
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvGastosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
@@ -786,6 +892,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero
|
||||
|
||||
'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1"
|
||||
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1"
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString)
|
||||
@@ -801,8 +910,59 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL GASTOS" Then
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 1 Then
|
||||
|
||||
'Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre,PorcentajeAcumulado
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0")
|
||||
|
||||
Else
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00")
|
||||
End If
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor)
|
||||
e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor)
|
||||
e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor)
|
||||
e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor)
|
||||
e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor)
|
||||
e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor)
|
||||
e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor)
|
||||
e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor)
|
||||
|
||||
|
||||
|
||||
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
|
||||
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
@@ -818,6 +978,52 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.Attributes.Add("style", "Font-weight: bold")
|
||||
|
||||
|
||||
If DdlDivisor.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0")
|
||||
|
||||
Else
|
||||
e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00")
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00")
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor)
|
||||
e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor)
|
||||
e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor)
|
||||
e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor)
|
||||
e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor)
|
||||
e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor)
|
||||
e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor)
|
||||
e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor)
|
||||
e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor)
|
||||
e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor)
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -928,6 +1134,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString
|
||||
Row.Item("PorcentajeAcumulado") = "100.00"
|
||||
Row.Item("CtaMayor") = -1
|
||||
Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico")
|
||||
DtIngresosAnualH.Rows.Add(Row)
|
||||
Else
|
||||
Row.Item("Nombre") = "TOTAL INGRESOS "
|
||||
@@ -989,7 +1196,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
IndexData = 13
|
||||
For IndexData = 13 To IndexMax
|
||||
|
||||
Row.Item(IndexData) = DtGastosAnualH.SUM($"[{DtIngresosAnualH.Columns(IndexData).ColumnName}]", "Not CtaMayor In (3,4)")
|
||||
|
||||
Next
|
||||
|
||||
Row.Item("Nombre") = "TOTAL GASTOS"
|
||||
@@ -998,6 +1207,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
|
||||
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero
|
||||
Row.Item("CtaMayor") = -1
|
||||
Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico")
|
||||
DtGastosAnualH.Rows.Add(Row)
|
||||
Else
|
||||
Row.Item("Nombre") = "TOTAL GASTOS"
|
||||
@@ -1018,11 +1228,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Next
|
||||
|
||||
Row.Item("Nombre") = "Resultados del Ejercicio"
|
||||
'Row.Item("ImporteActual") = TotalActual.ToString
|
||||
'Row.Item("PorcentajeActual") = "100.00"
|
||||
Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DtGastosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)")
|
||||
'Row.Item("PorcentajeAcumulado") = "100.00"
|
||||
'Row.Item("CtaMayor") = -1
|
||||
|
||||
|
||||
DTTotalesAnualH.Rows.Add(Row)
|
||||
|
||||
@@ -1062,19 +1269,37 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero
|
||||
Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField
|
||||
Dim Importe As String = e.Row.Cells(IndiceInicio).Text
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={CveSubProyecto}' >{Importe}</a>"
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={CveSubProyecto}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
|
||||
'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor)
|
||||
Next IndiceInicio
|
||||
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}"
|
||||
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<strong>{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</strong>"
|
||||
|
||||
Next IndiceInicio
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -1108,11 +1333,26 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField
|
||||
Dim Importe As String = e.Row.Cells(IndiceInicio).Text
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={CveSubProyecto}' >{Importe}</a>"
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={CveSubProyecto}' >{If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00"))}</a>"
|
||||
'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor)
|
||||
Next IndiceInicio
|
||||
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}"
|
||||
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<strong>{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</strong>"
|
||||
|
||||
Next IndiceInicio
|
||||
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
|
||||
@@ -1161,7 +1401,6 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
If DtDatosSubProyectoH IsNot Nothing And DTSubProyectosCabecerasH IsNot Nothing Then
|
||||
CargaGridsSubProyectoH()
|
||||
SumaTotalesSubProyectoH()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1186,9 +1425,6 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
If DtIngresosSubProyectoH.Rows.Count > 0 Then
|
||||
|
||||
|
||||
|
||||
|
||||
For Each dCoumn As DataColumn In DtIngresosSubProyectoH.Columns
|
||||
|
||||
If IndexData >= 13 Then
|
||||
@@ -1237,6 +1473,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString
|
||||
Row.Item("PorcentajeAcumulado") = "100.00"
|
||||
Row.Item("CtaMayor") = -1
|
||||
Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico")
|
||||
DtIngresosSubProyectoH.Rows.Add(Row)
|
||||
Else
|
||||
Row.Item("Nombre") = "TOTAL INGRESOS "
|
||||
@@ -1297,6 +1534,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
|
||||
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero
|
||||
Row.Item("CtaMayor") = -1
|
||||
Row.Item("CountDinamico") = DtGastosSubProyectoH.MAX("CountDinamico")
|
||||
|
||||
DtGastosSubProyectoH.Rows.Add(Row)
|
||||
Else
|
||||
Row.Item("Nombre") = "TOTAL GASTOS"
|
||||
@@ -1310,19 +1549,15 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
Row = DTTotalesSubProyectoH.NewRow
|
||||
|
||||
|
||||
|
||||
IndexData = 13
|
||||
For IndexData = 13 To IndexTotatles
|
||||
Row.Item(IndexData) = DtIngresosSubProyectoH.SUM($"[{DtIngresosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"[{DtGastosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)")
|
||||
Next
|
||||
|
||||
Row.Item("Nombre") = "Totales:"
|
||||
'Row.Item("ImporteActual") = TotalActual.ToString
|
||||
'Row.Item("PorcentajeActual") = "100.00"
|
||||
Row.Item("Nombre") = "Resultado del ejercicio"
|
||||
Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)")
|
||||
'Row.Item("PorcentajeAcumulado") = "100.00"
|
||||
Row.Item("CtaMayor") = -2
|
||||
Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico")
|
||||
|
||||
DTTotalesSubProyectoH.Rows.Add(Row)
|
||||
|
||||
@@ -1335,27 +1570,23 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
GvIngresosSubProyectoH.DataSource = DtIngresosSubProyectoH
|
||||
GvIngresosSubProyectoH.DataBind()
|
||||
|
||||
'GvGastosSubProyectoH.DataSource = DtGastosSubProyectoH
|
||||
'GvGastosSubProyectoH.DataBind()
|
||||
|
||||
'GvTotalesSubProyectoH.DataSource = DTTotalesSubProyectoH
|
||||
'GvTotalesSubProyectoH.DataBind()
|
||||
|
||||
UpDatosSubProyectoH.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SumaTotalesSubProyectoH()
|
||||
''Llena Lb´s Totales
|
||||
''*********************************************************************************
|
||||
'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero
|
||||
'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero
|
||||
'Private Sub SumaTotalesSubProyectoH()
|
||||
' ''Llena Lb´s Totales
|
||||
' ''*********************************************************************************
|
||||
' 'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero
|
||||
' 'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero
|
||||
|
||||
'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black)
|
||||
'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black)
|
||||
' 'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black)
|
||||
' 'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black)
|
||||
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
Protected Sub GvIngresosSubProyectoH_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
@@ -1391,17 +1622,47 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
|
||||
Dim CveSubProyectoIntermo As String = CType(GvGastosSubProyectoH.Columns(IndiceInicio), BoundField).DataField
|
||||
Dim Importe As String = e.Row.Cells(IndiceInicio).Text
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyectoIntermo}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
|
||||
|
||||
|
||||
|
||||
e.Row.Cells(IndiceInicio).Text = $"<a target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyectoIntermo}' >{Importe}</a>"
|
||||
Next IndiceInicio
|
||||
|
||||
e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={-1}"
|
||||
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<div { If(Importe < 0, "style='color:Red;'", "style='color:#000000;'") } ><strong>{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</strong></div>"
|
||||
Next IndiceInicio
|
||||
|
||||
|
||||
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -2 Then
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
|
||||
For IndiceInicio = 1 To IndiceMax
|
||||
|
||||
Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal
|
||||
e.Row.Cells(IndiceInicio).Text = $"<div { If(Importe < 0, "style='color:Red;'", "style='color:#000000;'") } ><strong>{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</strong></div>"
|
||||
|
||||
Next IndiceInicio
|
||||
|
||||
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLAnterior").Text = If(DdlDivisor.SelectedValue.ToEntero > 1, e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0"), e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0.00"))
|
||||
|
||||
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
|
||||
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
@@ -1414,22 +1675,13 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
|
||||
TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble
|
||||
TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
|
||||
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
||||
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
||||
e.Row.ControlStyle.Font.Bold = True
|
||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
||||
'e.Row.CssClass = "SubTotales"
|
||||
e.Row.ControlStyle.Font.Bold = True
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
|
||||
'End If
|
||||
|
||||
'If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
|
||||
' e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
|
||||
'End If
|
||||
|
||||
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
|
||||
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
|
||||
@@ -1453,4 +1705,226 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "DESCARGA EXCEL"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
Imprimir("Excel")
|
||||
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
|
||||
|
||||
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
ExportToExcelG(GvIngresosMes, GvGastosMes, TMesT1, "Reporte_Mensual", UsuarioActual, "Mensual")
|
||||
ElseIf Tab.ActiveTabIndex = 1 Then
|
||||
ExportToExcelG(GvIngresosMesH, GvGastosMesH, TMesT1, "Reporte_Mensual_Horizontal", UsuarioActual, "Mensual Horizontal", Gv3:=GvTotalesMesH)
|
||||
ElseIf Tab.ActiveTabIndex = 2 Then
|
||||
ExportToExcelG(GvIngresosAnualH, GvGastosAnualH, TMesT1, "Reporte_Anual_Horizontal", UsuarioActual, "Anual Horizontal", Gv3:=GvTotalesAnualH)
|
||||
|
||||
ElseIf Tab.ActiveTabIndex = 3 Then
|
||||
ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, "Proyecto Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
'Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100)
|
||||
Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, TablaResultados As HtmlTable, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional Gv3 As GridView = Nothing, Optional EsPorSubProtyecto As Boolean = False)
|
||||
|
||||
Dim sw1 As New StringWriter()
|
||||
Dim htw1 As New HtmlTextWriter(sw1)
|
||||
Gv1.RenderControl(htw1)
|
||||
|
||||
Dim sw2 As New StringWriter()
|
||||
Dim htw2 As New HtmlTextWriter(sw2)
|
||||
Gv2.RenderControl(htw2)
|
||||
|
||||
|
||||
TablaResultados.Width = Gv2.Width.ToString
|
||||
|
||||
Dim sw3 As New StringWriter()
|
||||
Dim htw3 As New HtmlTextWriter(sw3)
|
||||
TablaResultados.RenderControl(htw3)
|
||||
|
||||
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
|
||||
|
||||
Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
|
||||
Dim htmlStream2 = New MemoryStream(options.Encoding.GetBytes(sw2.ToString()))
|
||||
Dim htmlStream3 = New MemoryStream(options.Encoding.GetBytes(sw3.ToString()))
|
||||
|
||||
htmlStream1.Position = 0
|
||||
Dim sr1 As New StreamReader(htmlStream1)
|
||||
|
||||
htmlStream2.Position = 0
|
||||
Dim sr2 As New StreamReader(htmlStream2)
|
||||
|
||||
htmlStream3.Position = 0
|
||||
Dim sr3 As New StreamReader(htmlStream3)
|
||||
|
||||
|
||||
Dim myStr1 = sr1.ReadToEnd()
|
||||
Dim myStr2 = sr2.ReadToEnd()
|
||||
Dim myStr3 = sr3.ReadToEnd()
|
||||
|
||||
sr1.Dispose()
|
||||
sr2.Dispose()
|
||||
sr3.Dispose()
|
||||
|
||||
htmlStream1.Dispose()
|
||||
htmlStream2.Dispose()
|
||||
htmlStream3.Dispose()
|
||||
|
||||
sw1.Dispose()
|
||||
sw2.Dispose()
|
||||
sw3.Dispose()
|
||||
|
||||
If Gv3 IsNot Nothing Then
|
||||
|
||||
Gv3.ShowHeader = False
|
||||
|
||||
Dim sw4 As New StringWriter()
|
||||
Dim htw4 As New HtmlTextWriter(sw4)
|
||||
Gv3.RenderControl(htw4)
|
||||
Dim htmlStream4 = New MemoryStream(options.Encoding.GetBytes(sw4.ToString()))
|
||||
htmlStream4.Position = 0
|
||||
Dim sr4 As New StreamReader(htmlStream4)
|
||||
myStr3 = sr4.ReadToEnd()
|
||||
|
||||
sr4.Dispose()
|
||||
htmlStream2.Dispose()
|
||||
sw4.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim HtmlCompleto As String = myStr1 & "<br>" & myStr2 & "<br>" & myStr3
|
||||
|
||||
Dim asd As String = ""
|
||||
|
||||
|
||||
Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
|
||||
|
||||
|
||||
|
||||
|
||||
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8")
|
||||
|
||||
Dim excel As GemBox.Spreadsheet.ExcelFile
|
||||
'Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
|
||||
|
||||
'Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
|
||||
' excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
|
||||
|
||||
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options)
|
||||
|
||||
If Usuario IsNot Nothing Then
|
||||
Dim TotalRowHeader As Integer = 8
|
||||
Dim TotalRowFooter As Integer = 2
|
||||
|
||||
Dim worksheet = excel.Worksheets(0)
|
||||
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
|
||||
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
|
||||
celdasConTexto.Style.Font.Name = "Calibri Light"
|
||||
|
||||
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
|
||||
RangoNombreEmpresa.Merged = True
|
||||
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
|
||||
RangoNombreEmpresa.Style.Font.Size = 18 * 20
|
||||
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
|
||||
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
|
||||
'Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
|
||||
'RangoFiltros.Merged = True
|
||||
'RangoFiltros.Value = "Filtros"
|
||||
'RangoFiltros.Style.Font.Size = 15 * 20
|
||||
'RangoFiltros.Style.Font.Name = "Calibri Light"
|
||||
'RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
|
||||
'RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
|
||||
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
|
||||
RangoTitulo.Merged = True
|
||||
RangoTitulo.Value = Titulo
|
||||
RangoTitulo.Style.Font.Size = 20 * 20
|
||||
RangoTitulo.Style.Font.Name = "Calibri Light"
|
||||
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
|
||||
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
|
||||
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
|
||||
|
||||
|
||||
If Not EsPorSubProtyecto Then
|
||||
worksheet.Rows(8 + Gv1.Rows.Count + 2).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(8 + Gv1.Rows.Count + 2).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
Else
|
||||
worksheet.Rows(18).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(18).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If i > 0 Then
|
||||
Try
|
||||
worksheet.Columns(i).AutoFit(1)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim IndexEndTable As Integer = Gv1.Rows.Count + Gv2.Rows.Count + 4 + TotalRowHeader + TotalRowFooter
|
||||
|
||||
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
|
||||
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
|
||||
|
||||
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
|
||||
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
|
||||
|
||||
If Imagen.Exists Then
|
||||
Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
|
||||
Using sr As New StreamReader(Ruta)
|
||||
Dim ms As New MemoryStream()
|
||||
sr.BaseStream.CopyTo(ms)
|
||||
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
|
||||
End Using
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'End Using
|
||||
'htw.Dispose()
|
||||
|
||||
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user