Click here to Skip to main content
15,884,628 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 37.9K   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

    '*********************************************************************
    '
    ' SimpleReport Class
    '
    ' The SimpleReport class is used to represent a data item for Simple Report 
    ' and is mainly used to retrieve data from the database.
    '
    '*********************************************************************

    Public Class SimpleReport
        Private _city As String
        Private _companyName As String
        Private _contactName As String
        Private _contactTitle As String
        Private _phone As String

        Public Property City() As String
            Get
                Return _city
            End Get
            Set(ByVal Value As String)
                _city = Value
            End Set
        End Property

        Public Property CompanyName() As String
            Get
                Return _companyName
            End Get
            Set(ByVal Value As String)
                _companyName = Value
            End Set
        End Property

        Public Property ContactName() As String
            Get
                Return _contactName
            End Get
            Set(ByVal Value As String)
                _contactName = Value
            End Set
        End Property

        Public Property ContactTitle() As String
            Get
                Return _contactTitle
            End Get
            Set(ByVal Value As String)
                _contactTitle = Value
            End Set
        End Property

        Public Property Phone() As String
            Get
                Return _phone
            End Get
            Set(ByVal Value As String)
                _phone = Value
            End Set
        End Property

        '*********************************************************************
        '
        ' GetCustomerContacts method retrieves all the necessary customer contacts
        ' information from the database and transforms the result to a SimpleReportCollection
        ' custom colletion before returning it to the calling function
        '
        '*********************************************************************

        Public Shared Function GetCustomerContacts() As SimpleReportCollection
            Dim dsData As DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString), "Reports_GetCustomerContacts")
            Dim items As New SimpleReportCollection()

            Dim row As DataRow
            For Each row In dsData.Tables(0).Rows
                Dim item As New SimpleReport()
                item.City = row("City").ToString()
                item.CompanyName = row("CompanyName").ToString()
                item.ContactName = row("ContactName").ToString()
                item.ContactTitle = row("ContactTitle").ToString()
                item.Phone = row("Phone").ToString()
                items.Add(item)
            Next row
            Return items
        End Function 'GetCustomerContacts
    End Class 'SimpleReport
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