Click here to Skip to main content
15,895,011 members
Articles / Programming Languages / Visual Basic

Open Door - Reporting, Charts, Enquiry Drill-Downs

Rate me:
Please Sign up or sign in to vote.
4.37/5 (11 votes)
2 Feb 2009CPOL6 min read 39.4K   2K   59  
A utility for generating user editable reports, charts, documents, enquiries
Public Class nbfUserReportList
    Inherits System.Windows.Forms.Form
    Public Abandoned As Boolean
#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
    Friend WithEvents grdQryList As odGridControls.nbfGrid
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button

    '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 AppStyle3 As nbfStyleInfo.AppStyle = New nbfStyleInfo.AppStyle
        Me.grdQryList = New odGridControls.nbfGrid
        Me.btnOK = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'grdQryList
        '
        Me.grdQryList.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.grdQryList.HDBC = Nothing
        Me.grdQryList.Location = New System.Drawing.Point(2, 2)
        Me.grdQryList.Name = "grdQryList"
        Me.grdQryList.RepBreak1HeadFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        Me.grdQryList.RepBreak2HeadFont = New System.Drawing.Font("Tahoma", 8.0!)
        Me.grdQryList.RepSubHeadFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        Me.grdQryList.RowCacheSize = 150
        Me.grdQryList.RowHeaderWidth = 18
        AppStyle3.ButtonBackColor = System.Drawing.Color.LightGray
        AppStyle3.ButtonForeColor = System.Drawing.Color.MidnightBlue
        AppStyle3.CtrlBackColour = System.Drawing.Color.WhiteSmoke
        AppStyle3.CtrlBorderStyle = System.Windows.Forms.BorderStyle.None
        AppStyle3.CtrlFont = New System.Drawing.Font("Tahoma", 8.0!)
        AppStyle3.CtrlForeColour = System.Drawing.Color.MidnightBlue
        AppStyle3.FormBackColour = System.Drawing.Color.LightSlateGray
        AppStyle3.FormFont = New System.Drawing.Font("Tahoma", 8.0!)
        AppStyle3.FormForeColour = System.Drawing.Color.WhiteSmoke
        AppStyle3.GridAlternatingBackColor = System.Drawing.Color.Lavender
        AppStyle3.GridBackColor = System.Drawing.Color.WhiteSmoke
        AppStyle3.GridBackgroundColor = System.Drawing.Color.LightGray
        AppStyle3.GridBorderStyle = System.Windows.Forms.BorderStyle.None
        AppStyle3.GridCaptionBackColor = System.Drawing.Color.LightSteelBlue
        AppStyle3.GridCaptionFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        AppStyle3.GridCaptionForecolor = System.Drawing.Color.MidnightBlue
        AppStyle3.GridFlatMode = True
        AppStyle3.GridFont = New System.Drawing.Font("Tahoma", 8.0!)
        AppStyle3.GridForecolor = System.Drawing.Color.MidnightBlue
        AppStyle3.GridHeaderBackColor = System.Drawing.Color.MidnightBlue
        AppStyle3.GridHeaderFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        AppStyle3.GridHeaderForecolor = System.Drawing.Color.WhiteSmoke
        AppStyle3.GridLinecolor = System.Drawing.Color.Gainsboro
        AppStyle3.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None
        AppStyle3.GridLinkcolor = System.Drawing.Color.Teal
        AppStyle3.GridParentRowsBackColor = System.Drawing.Color.Gainsboro
        AppStyle3.GridParentRowsForecolor = System.Drawing.Color.MidnightBlue
        AppStyle3.GridPreferredColumnWidth = 100
        AppStyle3.GridPreferredRowHeight = 20
        AppStyle3.GridSelectionBackColor = System.Drawing.Color.CadetBlue
        AppStyle3.GridSelectionForecolor = System.Drawing.Color.WhiteSmoke
        AppStyle3.HeadButtonBackColor = System.Drawing.Color.WhiteSmoke
        AppStyle3.InfoLabelBackColor = System.Drawing.Color.LightSlateGray
        AppStyle3.InfoLabelBorderStyle = System.Windows.Forms.BorderStyle.None
        AppStyle3.InfoLabelFont = New System.Drawing.Font("Tahoma", 8.0!)
        AppStyle3.InfoLabelForeColor = System.Drawing.Color.Cyan
        AppStyle3.LabelBackColor = System.Drawing.Color.LightSlateGray
        AppStyle3.LabelBorderStyle = System.Windows.Forms.BorderStyle.None
        AppStyle3.LabelFont = New System.Drawing.Font("Tahoma", 8.0!)
        AppStyle3.LabelForeColor = System.Drawing.Color.WhiteSmoke
        AppStyle3.SkinName = "Standard"
        AppStyle3.StdTextBoxHeight = 18
        Me.grdQryList.SI = AppStyle3
        Me.grdQryList.Size = New System.Drawing.Size(404, 270)
        Me.grdQryList.SourceGList = Nothing
        Me.grdQryList.SourceObject = Nothing
        Me.grdQryList.SourceObjectType = Nothing
        Me.grdQryList.SourceSQL = Nothing
        Me.grdQryList.SourceTable = Nothing
        Me.grdQryList.TabIndex = 0
        Me.grdQryList.Text = "NbfBrowseGrid1"
        Me.grdQryList.TopGroupHeaderHeight = 18
        '
        'btnOK
        '
        Me.btnOK.Location = New System.Drawing.Point(421, 27)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(52, 19)
        Me.btnOK.TabIndex = 1
        Me.btnOK.Text = "OK"
        Me.btnOK.UseVisualStyleBackColor = True
        '
        'btnCancel
        '
        Me.btnCancel.Location = New System.Drawing.Point(421, 52)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(52, 19)
        Me.btnCancel.TabIndex = 2
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.UseVisualStyleBackColor = True
        '
        'nbfUserReportList
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(485, 273)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.btnOK)
        Me.Controls.Add(Me.grdQryList)
        Me.Name = "nbfUserReportList"
        Me.Text = "User Report List"
        Me.ResumeLayout(False)

    End Sub

#End Region
    Sub SetGrid()
        If grdQryList.Columns.count = 0 Then
            Dim gc As New odGridControls.nbfGridColumn
            gc.ColumnName = "Report Descrption"
            gc.BoundColumn = True
            grdQryList.Columns.Add(gc)
            grdQryList.RowHeadersVisible = False
            grdQryList.GridCaptionVisible = False
        End If

        grdQryList.AutoScaleColumnWidths = True
        grdQryList.AllowEdit = False
        grdQryList.AllowAdd = False
        grdQryList.RowHeadersVisible = False
        grdQryList.GridCaptionVisible = False
        grdQryList.ColHeadersVisible = False

    End Sub
    Sub optClick(ByVal sender As Object, ByVal e As System.EventArgs)
        BuildList()
    End Sub
    Sub BuildList()
        grdQryList.ReleaseBinding()
        Dim qtxt As String = ""
        Dim qdir As String = System.Windows.Forms.Application.StartupPath & "\UserReports"
        qdir = Dir(qdir & "\*.SQZ")
        'If qdir = "" Then
        'MsgBox("No Saved Reports")
        'Exit Sub
        'End If
        'ql.grdQryList.Columns.Clear()
        Do While qdir <> ""
            qtxt = Mid(qdir, 1, qdir.Length - 4)
            AddGridRow(grdQryList, qtxt)
            qdir = Dir()
        Loop
    End Sub
    Private Sub AddGridRow(ByVal g As odGridControls.nbfGrid, ByVal txt As String)
        Try
            Dim ncd As New odGridControls.nbfGridCellData
            ncd.CellValue = txt
            Dim gr As New odGridControls.nbfGridRow
            gr.RowHeight = 18
            gr.RowData.Add(ncd)
            g.AddGridAddItemRow(gr)
        Catch ex As Exception

        End Try
    End Sub
    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Abandoned = False
        Me.Hide()
    End Sub
    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Abandoned = True
        Me.Hide()
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions