Click here to Skip to main content
15,896,118 members
Articles / Containers / Virtual Machine

ASP.NET Report Kit Grasshoper (Race to Linux)

Rate me:
Please Sign up or sign in to vote.
2.38/5 (5 votes)
2 Oct 20057 min read 38K   19  
Porting and deploying the report starter kit to Linux (RH7.3/Tomcat5.0.28/Grasshoper1.61)
Imports System
Imports System.Data
Imports System.Configuration
Imports ASPNET.StarterKit.Reports.DataAccessLayer
Imports System.Collections

Namespace ASPNET.StarterKit.Reports.Components

    Public Class TextReport
        Private _employeeName As String
        Private _employeeNotes As String
        Private _employeeTitle As String
        Private _employeeExt As String
        Private _employeeAddress As String
        Private _employeeCity As String
        Private _employeeState As String
        Private _employeeZip As String

        Public Property EmployeeName() As String
            Get
                Return _employeeName
            End Get
            Set(ByVal Value As String)
                _employeeName = Value
            End Set
        End Property

        Public Property EmployeeNotes() As String
            Get
                Return _employeeNotes
            End Get
            Set(ByVal Value As String)
                _employeeNotes = Value
            End Set
        End Property

        Public Property EmployeeTitle() As String
            Get
                Return _employeeTitle
            End Get
            Set(ByVal Value As String)
                _employeeTitle = Value
            End Set
        End Property

        Public Property EmployeeExt() As String
            Get
                Return _employeeExt
            End Get
            Set(ByVal Value As String)
                _employeeExt = Value
            End Set
        End Property

        Public Property EmployeeAddress() As String
            Get
                Return _employeeAddress
            End Get
            Set(ByVal Value As String)
                _employeeAddress = Value
            End Set
        End Property

        Public Property EmployeeCity() As String
            Get
                Return _employeeCity
            End Get
            Set(ByVal Value As String)
                _employeeCity = Value
            End Set
        End Property

        Public Property EmployeeState() As String
            Get
                Return _employeeState
            End Get
            Set(ByVal Value As String)
                _employeeState = Value
            End Set
        End Property

        Public Property EmployeeZip() As String
            Get
                Return _employeeZip
            End Get
            Set(ByVal Value As String)
                _employeeZip = Value
            End Set
        End Property

        '*********************************************************************
        '
        ' GetEmployees()
        '
        ' This function calls the "GetEmployees" stored procedure, and for 
        ' every row in the resulting DataSet, inserts an item into the 
        ' thin class TextReportCollection.  TextReportCollection is simply
        ' an ArrayList holding the public property values "EmployeeName", 
        ' "EmployeeNotes", "EmployeeTitle", "EmployeeExt", "EmployeeAddress",
        ' "EmployeeCity", "EmployeeState", and "EmployeeZip".
        '
        '*********************************************************************

        Public Shared Function GetEmployees() As TextReportCollection
            Dim dsData As DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString), "Reports_GetEmployees")
            Dim items As New TextReportCollection()

            Dim row As DataRow
            For Each row In dsData.Tables(0).Rows
                Dim item As New TextReport()
                item.EmployeeName = row("EmployeeName").ToString()
                item.EmployeeNotes = row("EmployeeNotes").ToString()
                item.EmployeeTitle = row("EmployeeTitle").ToString()
                item.EmployeeExt = row("EmployeeExt").ToString()
                item.EmployeeAddress = row("EmployeeAddress").ToString()
                item.EmployeeCity = row("EmployeeCity").ToString()
                item.EmployeeState = row("EmployeeState").ToString()
                item.EmployeeZip = row("EmployeeZip").ToString()

                items.Add(item)
            Next row

            Return items
        End Function 'GetEmployees
    End Class 'TextReport
End Namespace 'ASPNET.StarterKit.Reports.Components

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
I love to code! Working in C# is my passion, visit my github

Comments and Discussions