client/Graficas/Patron Transacciones.vb

91 lines
3.4 KiB
VB.net

Public Class Patron_Transacciones
Dim clCmp As clsComplejo = New clsComplejo
' Dim frmRepInu As InusualesDivisas = New InusualesDivisas
Private Sub Patron_Transacciones_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
confChart() 'llamo al sub que configura la grafica
cargaGrafica()
End Sub
Private Sub confChart()
Try
With Chart1
'Configuracion del CHART
.ToolBar = True
.SerLegBox = True
.AllowDrag = False
.AllowEdit = False
.ContextMenus = False
.ShowTips = True
.Scrollable = True
.DataEditor = True
.AutoScroll = True
End With
'Configuro los ejes del chart
'Chart1.Axis(2).AutoScale = True
'Chart1.Axis(0).LabelsFormat.Format = SoftwareFX.ChartFX.AxisFormat.Currency
Chart1.AxisY.Title.Text = "Transacciones"
Chart1.AxisX.Title.Text = "Fecha (dd/mm/yyyy)"
Chart1.Titles(0).Text = "Cuenta - " & clCmp._NoCuenta
Chart1.Grid = SoftwareFX.ChartFX.ChartGrid.Horz Or SoftwareFX.ChartFX.ChartGrid.Vert
'Chart1.MenuBarObj
'chart1.ToolBarObj[11] = (int) CommandID.se
'Chart1.Commands(chartfx.WinForms.CommandId.ContextMenuTool).SubCommands()
'Chart1.Commands.Item(12).SubCommandID(12)
'Chart1.Printer.UsePrinterResolution = True
Catch ex As Exception
MessageBox.Show("Error en MontoGrafica; confChart: " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub cargaGrafica()
'Declaro mis variables, (parametros para el stroe procedure)
Try
Dim _FechaInicio As String
Dim _FechaFin As String
Dim _NoCuenta As String
Dim _TipoReporte As Integer
Dim Classcom As New clsComplejo
Dim lngParmed As Long
'Asigancion de valores
_TipoReporte = clCmp.TipoReporte 'Asignacion para ver que tipo de prodcuto se carga
_NoCuenta = clCmp._NoCuenta
_FechaInicio = clCmp._FechaIni
_FechaFin = clCmp._FechaFin
lngParmed = Classcom.BuscaValores("id_parmedicion", "productopatron", "idproducto = " & _TipoReporte & " and id_patron = 5")
'Formo el query
Dim cadSQL As String
cadSQL = ""
cadSQL = "spTransaccionGrafica "
cadSQL = cadSQL & "'" & Classcom.ObtenFecha(_FechaInicio, "yyyymmdd") & "', "
cadSQL = cadSQL & "'" & Classcom.ObtenFecha(_FechaFin, "yyyymmdd") & "', "
cadSQL = cadSQL & "'" & _NoCuenta.Trim & "', "
cadSQL = cadSQL & lngParmed
'MessageBox.Show(cadSQL, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
'Ejecuto el query
'MsgBox(cadSQL)
clCmp.fdDataReader(cadSQL)
'MsgBox("ANTES EJECUTO SP")
Chart1.DataSourceSettings.DataSource = clCmp.dr
Chart1.DataEditor = True
Catch ex As Exception
MessageBox.Show("Error en MontoGrafica; cargaGrafica: " & ex.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Chart1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chart1.Load
End Sub
End Class