|
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.
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