Click here to Skip to main content
15,886,737 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)
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">Imports</font> System
<font color= "blue">Imports</font> System.Data
<font color= "blue">Imports</font> System.Configuration
<font color= "blue">Imports</font> System.Collections
<font color= "blue">Imports</font> ASPNET.StarterKit.Reports.DataAccessLayer
<font color= "blue"></font>
<font color= "blue">Namespace</font> ASPNET.StarterKit.Reports.Components
<font color= "blue"></font>
<font color= "blue">    Public Class</font> MasterDetailReport
<font color= "blue">        Private </font>_orderDate <font color= "blue">As </font>DateTime
<font color= "blue">        Private </font>_orderID <font color= "blue">As </font>Integer
<font color= "blue">        Private </font>_ordersShipped <font color= "blue">As </font>Integer
<font color= "blue">        Private </font>_quarter <font color= "blue">As </font>Integer
<font color= "blue">        Private </font>_sales <font color= "blue">As </font>Decimal
<font color= "blue"></font>
<font color= "blue">        Public Property</font> OrderDate() As DateTime
<font color= "blue">            Get</font>
<font color= "blue">                </font>Return <font color= "blue"></font>_orderDate
<font color= "blue">            End Get</font>
<font color= "blue">            </font>Set(ByVal Value As DateTime)
<font color= "blue">                </font>_orderDate <font color= "blue"></font>= Value
<font color= "blue">            End Set</font>
<font color= "blue">        End Property</font>
<font color= "blue"></font>
<font color= "blue">        Public Property</font> OrderID() As Integer
<font color= "blue">            Get</font>
<font color= "blue">                </font>Return <font color= "blue"></font>_orderID
<font color= "blue">            End Get</font>
<font color= "blue">            </font>Set(ByVal Value As Integer)
<font color= "blue">                </font>_orderID <font color= "blue"></font>= Value
<font color= "blue">            End Set</font>
<font color= "blue">        End Property</font>
<font color= "blue"></font>
<font color= "blue">        Public Property</font> OrdersShipped() As Integer
<font color= "blue">            Get</font>
<font color= "blue">                </font>Return <font color= "blue"></font>_ordersShipped
<font color= "blue">            End Get</font>
<font color= "blue">            </font>Set(ByVal Value As Integer)
<font color= "blue">                </font>_ordersShipped <font color= "blue"></font>= Value
<font color= "blue">            End Set</font>
<font color= "blue">        End Property</font>
<font color= "blue"></font>
<font color= "blue">        Public Property</font> Quarter() As Integer
<font color= "blue">            Get</font>
<font color= "blue">                </font>Return <font color= "blue"></font>_quarter
<font color= "blue">            End Get</font>
<font color= "blue">            </font>Set(ByVal Value As Integer)
<font color= "blue">                </font>_quarter <font color= "blue"></font>= Value
<font color= "blue">            End Set</font>
<font color= "blue">        End Property</font>
<font color= "blue"></font>
<font color= "blue">        Public Property</font> Sales() As Decimal
<font color= "blue">            Get</font>
<font color= "blue">                </font>Return <font color= "blue"></font>_sales
<font color= "blue">            End Get</font>
<font color= "blue">            </font>Set(ByVal Value As Decimal)
<font color= "blue">                </font>_sales <font color= "blue"></font>= Value
<font color= "blue">            End Set</font>
<font color= "blue">        End Property</font>
<font color= "blue"></font>
<font color= "blue">        Public Shared Function</font> GetSummary(ByVal year As Integer) As MasterDetailReportCollection
<font color= "blue">            Dim </font>dsData <font color= "blue">As </font>DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString), "Reports_GetOrderSummary", year)
<font color= "blue">            Dim </font>items <font color= "blue">As </font>New MasterDetailReportCollection()
<font color= "blue"></font>
<font color= "blue">            Dim </font>row <font color= "blue">As </font>DataRow
<font color= "blue">            For Each</font> row In dsData.Tables(0).Rows
<font color= "blue">                Dim </font>item <font color= "blue">As </font>New MasterDetailReport()
<font color= "blue">                </font>item.Quarter = Convert.ToInt32(row("Quarter"))
<font color= "blue">                </font>item.OrdersShipped = Convert.ToInt32(row("OrdersShipped"))
<font color= "blue">                </font>item.Sales = Convert.ToDecimal(row("Sales"))
<font color= "blue">                </font>items.Add(item)
<font color= "blue">            Next</font> row
<font color= "blue">            </font>Return <font color= "blue"></font>items
<font color= "blue"></font><font color= "blue">        End Function</font><font color= "blue"></font><font color= "green"> 'GetSummary</font>
<font color= "blue"></font>
<font color= "blue">        Public Shared Function</font> GetDetails(ByVal year As Integer, ByVal quarter As Integer) As MasterDetailReportCollection
<font color= "blue">            Dim </font>dsData <font color= "blue">As </font>DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString), "Reports_GetOrdersAndDetails", year, quarter)
<font color= "blue">            Dim </font>items <font color= "blue">As </font>New MasterDetailReportCollection()
<font color= "blue"></font>
<font color= "blue">            Dim </font>row <font color= "blue">As </font>DataRow
<font color= "blue">            For Each</font> row In dsData.Tables(0).Rows
<font color= "blue">                Dim </font>item <font color= "blue">As </font>New MasterDetailReport()
<font color= "blue">                </font>item.OrderID = Convert.ToInt32(row("OrderID"))
<font color= "blue">                </font>item.OrderDate = Convert.ToDateTime(row("OrderDate"))
<font color= "blue">                </font>item.Sales = Convert.ToDecimal(row("Sales"))
<font color= "blue">                </font>items.Add(item)
<font color= "blue">            Next</font> row
<font color= "blue">            </font>Return <font color= "blue"></font>items
<font color= "blue"></font><font color= "blue">        End Function</font><font color= "blue"></font><font color= "green"> 'GetDetails</font>
<font color= "blue"></font><font color= "blue">    End Class</font><font color= "blue"></font><font color= "green"> 'MasterDetailReport</font>
<font color= "blue"></font><font color= "blue">End Namespace</font><font color= "blue"></font><font color= "green"> 'ASPNET.StarterKit.Reports.Components</font>
</pre>

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