client/Graficas/MontoGrafica.vb

160 lines
6.0 KiB
VB.net

Public Class MontoGrafica
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private WithEvents Chart1 As SoftwareFX.ChartFX.Chart
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(MontoGrafica))
Me.Chart1 = New SoftwareFX.ChartFX.Chart()
Me.SuspendLayout()
'
'Chart1
'
Me.Chart1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Chart1.AxisX.Font = New System.Drawing.Font("Arial", 8.0!)
Me.Chart1.AxisX.LabelAngle = CType(90, Short)
Me.Chart1.DataEditorObj.ShowHiddenSeries = True
Me.Chart1.DesignTimeData = ""
Me.Chart1.Font = New System.Drawing.Font("Arial", 8.0!)
Me.Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Lines
Me.Chart1.LegendBoxObj.AutoSize = False
Me.Chart1.LegendBoxObj.Height = 0
Me.Chart1.LegendBoxObj.Width = 0
Me.Chart1.Location = New System.Drawing.Point(1, 1)
Me.Chart1.MarkerSize = CType(4, Short)
Me.Chart1.Name = "Chart1"
Me.Chart1.Size = New System.Drawing.Size(1070, 510)
Me.Chart1.TabIndex = 0
'
'MontoGrafica
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(1074, 523)
Me.Controls.Add(Me.Chart1)
Me.Cursor = System.Windows.Forms.Cursors.Default
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "MontoGrafica"
Me.Text = "Tendencia del Patron Monto"
Me.ResumeLayout(False)
End Sub
#End Region
Dim clCmp As clsComplejo = New clsComplejo
'Dim frmRepInu As InusualesDivisas = New InusualesDivisas
Private Sub MontoGrafica_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 = "Monto"
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
'Asigancion de valores
_TipoReporte = clCmp.TipoReporte 'Asignacion para ver que tipo de prodcuto se carga
_NoCuenta = clCmp._NoCuenta
_FechaInicio = clCmp._FechaIni
_FechaFin = clCmp._FechaFin
'Formo el query
Dim cadSQL As String
cadSQL = ""
cadSQL = "spMontoGrafica "
cadSQL = cadSQL & "'" & Classcom.ObtenFecha(_FechaInicio, "YYYYMMDD") & "', "
cadSQL = cadSQL & "'" & Classcom.ObtenFecha(_FechaFin, "YYYYMMDD") & "', "
cadSQL = cadSQL & "'" & _NoCuenta.Trim & "', "
cadSQL = cadSQL & _TipoReporte
'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