79 lines
3.6 KiB
VB.net
79 lines
3.6 KiB
VB.net
Public Class FrmIngresosDepositos
|
|
|
|
Private Sub FrmIngresosDepositos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
End Sub
|
|
|
|
Private Sub BTEjecutar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTEjecutar.Click
|
|
Dim Classcom As New clsComplejo
|
|
Dim SQL As String
|
|
Try
|
|
SQL = "spSReporteIngreDepo " & DTPInicial.Value.Year.ToString() & ", " & DTPInicial.Value.Month.ToString() & ", " & DTPFinal.Value.Year.ToString() & ", " & DTPFinal.Value.Month.ToString()
|
|
Classcom.fdtDataSetTabla(SQL)
|
|
|
|
Me.GRDMasterRep.SetDataBinding(Classcom.ds, "Tabla")
|
|
Me.GRDMasterRep.Columns(2).NumberFormat = "###,###,##0.00"
|
|
Me.GRDMasterRep.Columns(3).NumberFormat = "###,###,##0.00"
|
|
GRDMasterRep.Splits(0).DisplayColumns(0).Visible = False
|
|
For Each col As C1.Win.C1TrueDBGrid.C1DisplayColumn In GRDMasterRep.Splits(0).DisplayColumns
|
|
col.AutoSize()
|
|
Next
|
|
clsVaribles.strSQL = SQL
|
|
|
|
GRDMasterRep.Visible = True
|
|
|
|
''Auditoria
|
|
Dim ClassAud As New ClassMyUtils
|
|
Dim sTextoAud As String
|
|
sTextoAud = "Reporte de Ingresos/Depósitos , mes y año inicial: " & DTPInicial.Value.ToString("MMMM/yyyy") & ", mes y año final: " & DTPFinal.Value.ToString("MMMM/yyyy")
|
|
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 118, 1, sTextoAud)
|
|
''Fin de auditoria
|
|
|
|
Catch ex As Exception
|
|
MessageBox.Show(ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub BTExportar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTExportar.Click
|
|
Dim Clcmp As New clsComplejo
|
|
|
|
Try
|
|
|
|
Clcmp.fdtDataSetTabla(clsVaribles.strSQL)
|
|
|
|
If Clcmp.ds.Tables.Count = 0 Then
|
|
MessageBox.Show("Realiza una consulta ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
|
Else
|
|
If Clcmp.ds.Tables(0).Rows.Count = 0 Then
|
|
MessageBox.Show("No hay datos para exportar ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
|
Else
|
|
Dim Resul As DialogResult
|
|
Resul = MessageBox.Show("Este proceso puede tardar varios minutos, ¿Deseas continuar? ", "MINDS", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
|
If Resul = DialogResult.Yes Then
|
|
'Creamos una copia del dataset
|
|
Dim copyDS As DataSet = Clcmp.ds.Copy()
|
|
'Quitamos las siguientes columnas para no exportarlas
|
|
|
|
'copyDS.Tables(0).Columns.Remove("Id_Transaccion")
|
|
'copyDS.Tables(0).Columns.Remove("Id_Producto")
|
|
|
|
'Creo una instancia de la clase aExcel
|
|
Dim clsExcel As aExcel = New aExcel
|
|
'Obtenemos el nombre o el titulo del form
|
|
clsExcel.Titulo = Me.Text
|
|
'Utilizo la funcion ExportDataset de la clase aExcel
|
|
clsExcel.ExportDataset(copyDS) 'Asigno el dataset a exportar
|
|
End If
|
|
End If
|
|
End If
|
|
Catch ex As Exception
|
|
MessageBox.Show(ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub BTSalir_Click(sender As System.Object, e As System.EventArgs) Handles BTSalir.Click
|
|
Me.Close()
|
|
End Sub
|
|
End Class |