Compras.aspx validaicon error con conpaq
This commit is contained in:
@@ -4,6 +4,7 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports System.Windows.Forms
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
@@ -13,6 +14,24 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Property DTRatios As DataTable
|
||||
Get
|
||||
If ViewState("DTRatios") Is Nothing Then
|
||||
ViewState("DTRatios") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DTRatios"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTRatios") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
@@ -107,14 +126,14 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnkExportar.Visible = False
|
||||
|
||||
|
||||
If TAB.ActiveTabIndex = 0 Then
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
CargaDatosBalanceGeneral()
|
||||
End If
|
||||
|
||||
|
||||
If TAB.ActiveTabIndex = 1 Then
|
||||
If Tab.ActiveTabIndex = 1 Then
|
||||
CargaDatosEstadoResultados()
|
||||
End If
|
||||
|
||||
@@ -158,7 +177,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
GVEstadoRsultados.DataSource = dtTemp
|
||||
|
||||
If dtTemp.Rows.Count > 0 Then
|
||||
LnkExportar.Visible = True
|
||||
' LnkExportar.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -203,6 +222,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
If e.Row.DataKey("Tipo").ToEntero = 1 Then
|
||||
e.Row.Font.Bold = True
|
||||
e.Row.Cells(0).Text = ""
|
||||
End If
|
||||
|
||||
If e.Row.DataKey("Tipo").ToEntero = 3 Then
|
||||
@@ -211,6 +231,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
If e.Row.DataKey("Tipo").ToEntero = 4 Then
|
||||
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
|
||||
e.Row.Cells(0).Text = ""
|
||||
End If
|
||||
|
||||
|
||||
@@ -229,6 +250,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
|
||||
|
||||
DTRatios = New DataTable
|
||||
|
||||
LnkExportar.Visible = False
|
||||
GVRatiosOcultarColumnas(GVRatios, 1)
|
||||
|
||||
@@ -241,16 +264,16 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
|
||||
Dim objFinanzas As New ClsFinanzas
|
||||
Dim dtTemp As New DataTable
|
||||
|
||||
|
||||
If objFinanzas.GetRazonesFinancierasRatiosRep(FechaI, FechaF, -1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, 12) Then
|
||||
dtTemp = objFinanzas.DtResultados
|
||||
DTRatios = objFinanzas.DtResultados
|
||||
|
||||
GVRatiosMostrarColumnas(dtTemp, GVRatios)
|
||||
GVRatios.DataSource = dtTemp
|
||||
GVRatiosMostrarColumnas(DTRatios, GVRatios)
|
||||
GVRatios.DataSource = DTRatios
|
||||
|
||||
If dtTemp.Rows.Count > 0 Then
|
||||
LnkExportar.Visible = True
|
||||
If DTRatios.Rows.Count > 0 Then
|
||||
' LnkExportar.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -274,19 +297,28 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
End Sub
|
||||
|
||||
Private Sub GVRatiosMostrarColumnas(dt As DataTable, ByRef Gv As GridView)
|
||||
Dim index = 1
|
||||
Dim index = 3
|
||||
|
||||
|
||||
For index = 1 To dt.Columns.Count - 2
|
||||
For index = 3 To dt.Columns.Count - 2
|
||||
CType(Gv.Columns(index + 1), BoundField).DataField = dt.Columns(index + 1).ColumnName
|
||||
|
||||
CType(Gv.Columns(index + 1), BoundField).DataFormatString = "{0:P2}"
|
||||
|
||||
|
||||
'CType(Gv.Columns(index + 1), BoundField).DataFormatString = "{0:P2}"
|
||||
Gv.Columns(index + 1).Visible = True
|
||||
CType(Gv.Columns(index + 1), BoundField).HeaderText = dt.Columns(index + 1).ColumnName
|
||||
|
||||
Next
|
||||
|
||||
'Dim Count As Integer = 1
|
||||
'For Each GvColumn As DataGridViewColumn In GVRatios.Columns
|
||||
|
||||
|
||||
' GvColumn.Width = If(Count = 1, 300, 75)
|
||||
|
||||
' Count = Count + 1
|
||||
'Next
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GVRatios_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
@@ -305,6 +337,25 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
|
||||
End If
|
||||
|
||||
If e.Row.DataKey("Tipo").ToEntero <> 1 AndAlso DTRatios.Columns.Count > 0 Then
|
||||
|
||||
Dim EsPorcentaje = If(e.Row.DataKey("EsPorcentaje").ToEntero = 1, True, False)
|
||||
|
||||
For x = 1 To DTRatios.Columns.Count - 2
|
||||
|
||||
'If e.Row.Cells(x).Text.ToDecimal = 0 Then
|
||||
' e.Row.Cells(x).Text = ""
|
||||
'Else
|
||||
If EsPorcentaje Then
|
||||
e.Row.Cells(x).Text = $"{(e.Row.Cells(x).Text.ToDecimal * 100.0).ToString("###.00")}%"
|
||||
Else
|
||||
e.Row.Cells(x).Text = $"{e.Row.Cells(x).Text.ToDecimal.ToString("###,###,###.00")}"
|
||||
End If
|
||||
'End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -323,12 +374,46 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
#Region "DESCARGA EXCEL"
|
||||
|
||||
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim SubProyecto As String = ""
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero > 0 Then
|
||||
SubProyecto = DdlSubproyecto.SelectedItem.Text
|
||||
End If
|
||||
|
||||
Dim SbFiltros As New StringBuilder()
|
||||
SbFiltros.Append($"Año Inicio: {DdlEjercicio.SelectedItem.Text} Año Fin: {DdlEjercicio2.SelectedItem.Text} ")
|
||||
SbFiltros.Append($"SubProyecto: {SubProyecto}")
|
||||
|
||||
Dim Titulo As String = ""
|
||||
Dim NombreReporte As String = ""
|
||||
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
Titulo = "Balance General"
|
||||
NombreReporte = "BalanceGenral"
|
||||
End If
|
||||
|
||||
If Tab.ActiveTabIndex = 1 Then
|
||||
Titulo = "Estado de Resultados"
|
||||
NombreReporte = "Estado de Resultados"
|
||||
End If
|
||||
|
||||
If Tab.ActiveTabIndex = 2 Then
|
||||
|
||||
Titulo = "Ratios"
|
||||
NombreReporte = "Ratios"
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
GVRatios.ExportToExcelGembox(NombreReporte, UsuarioActual, $"Reporte {Titulo}", "", DatosFiltros:=SbFiltros.ToString())
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -338,5 +423,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user