Click here to Skip to main content
15,896,154 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

    '*********************************************************************
    '
    ' VisualReport Class
    '
    ' The VisualReport class is used to represent a data item for Visual
    ' Report.
    '
    '*********************************************************************

    Public Class VisualReport
        Private _categoryName As String
        Private _sales As Decimal

        Public Property CategoryName() As String
            Get
                Return _categoryName
            End Get
            Set(ByVal Value As String)
                _categoryName = Value
            End Set
        End Property

        Public Property Sales() As Decimal
            Get
                Return _sales
            End Get
            Set(ByVal Value As Decimal)
                _sales = Value
            End Set
        End Property

        '*********************************************************************
        '
        ' GetCategorySales method retrieves the total of all category sales
        ' from the database and transforms the result to a VisualReportCollection
        ' custom colletion before returning it to the calling function
        '
        '*********************************************************************

        Public Shared Function GetCategorySales() As VisualReportCollection
            Dim dsData As DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString), "Reports_GetCategorySales")
            Dim items As New VisualReportCollection()

            Dim row As DataRow
            For Each row In dsData.Tables(0).Rows
                Dim item As New VisualReport()
                item.CategoryName = row("CategoryName").ToString()
                item.Sales = Convert.ToDecimal(row("Sales"))
                items.Add(item)
            Next row
            Return items
        End Function 'GetCategorySales
    End Class 'VisualReport
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