Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version

Race to Linux - Race 3: Reports Starter Kit using Mono SqlServer/Firebird

, 30 Sep 2005
Reports Starter Kit port to Linux using Mono
RaceToLinuxRace3_src.zip
RaceToLinuxRace3_src
bin
ASPNET.StarterKit.Reports.dll
FirebirdSql.Data.Firebird.dll
Components
BLL
DAL
docs
images
1x1.gif
crosstabnestedcontrols.png
crosstabtotals.png
customers.gif
drilldownnestedcontrols.png
employees.gif
getorderdetails.gif
getorders.gif
hierarchicalpaging.gif
hierarchicalreport.gif
hierarchicalschema.gif
hierarchicalsorting.gif
masterdetaildetails.png
masterdetailsummary.png
masterdetailtables.png
querysample.gif
querysample2.gif
simpleoverview.png
simplesp.png
tabdetail.png
tabheader.gif
tabheader.png
tabnestedcontrols.png
tabularcolorcode.png
tabularextendedprice.png
tabularsorting.png
textshot.gif
viscategorysales.gif
viscategorysales.png
vischartstructure.png
xtabsql.png
global.asax
images
asp.net-reports.gif
background.gif
crosstab.gif
drilldown.gif
grid_background.gif
hierarchical.gif
logo-neg.gif
logo.gif
masterdetail.gif
masterdetails.gif
report-table-bg.gif
simple.gif
spacer.gif
tabular.gif
textalternate.gif
textreport.gif
visual.gif
ReportsCSVS.csproj.webinfo
SourceViewer
1x1.gif
crosstab.src
drilldown.src
grid_background.gif
hierarchical.src
masterdetail.src
simple.src
tabular.src
textreport.src
visual.src
<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">using</font> System;
<font color= "blue">using</font> System.Data;
<font color= "blue">using</font> System.Configuration;
<font color= "blue">using</font> ASPNET.StarterKit.Reports.DataAccessLayer;
<font color= "blue">using</font> System.Collections;
<font color= "blue"></font>
<font color= "blue">namespace</font> ASPNET.StarterKit.Reports.Components
<font color= "blue"></font>{
<font color= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // TabularReport Class</font>
<font color= "green">    //</font>
<font color= "green">    // The TabularReport class is used to represent a data item for Tabular </font>
<font color= "green">    // Report and is mainly used to retrieve data from the database.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    public class</font> TabularReport
<font color= "blue">    </font>{
<font color= "blue">        private </font>int            _categoryID;
<font color= "blue">        private </font>string        _categoryName;
<font color= "blue">        private </font>string        _productName;
<font color= "blue">        private </font>string        _quantityPerUnit;
<font color= "blue">        private </font>int            _totalInStock;
<font color= "blue">        private </font>decimal        _unitPrice;
<font color= "blue">        private </font>int            _unitsInStock;
<font color= "blue">        </font>
<font color= "blue">        public </font>int CategoryID
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _categoryID; }
<font color= "blue">            set</font> { _categoryID = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string CategoryName
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _categoryName; }
<font color= "blue">            set</font> { _categoryName = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string ProductName
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _productName; }
<font color= "blue">            set</font> { _productName = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>string QuantityPerUnit
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _quantityPerUnit; }
<font color= "blue">            set</font> { _quantityPerUnit = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>int TotalInStock
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _totalInStock; }
<font color= "blue">            set</font> { _totalInStock = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>decimal UnitPrice
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _unitPrice; }
<font color= "blue">            set</font> { _unitPrice = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        public </font>int UnitsInStock
<font color= "blue">        </font>{
<font color= "blue">            get</font> { return _unitsInStock; }
<font color= "blue">            set</font> { _unitsInStock = value; }
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // GetCategories method retrieves all available category names with total </font>
<font color= "green">        // unit in stock information from the database and transforms the result </font>
<font color= "green">        // to a TabularReportCollection custom colletion before returning it to </font>
<font color= "green">        // the calling function.</font>
<font color= "green">        //</font>
<font color= "green">        // This method is called to get header information for the Tabular Report.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        public </font>static TabularReportCollection GetCategories()
<font color= "blue">        </font>{
<font color= "blue">            </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetCategories");
<font color= "blue">            </font>TabularReportCollection items = new TabularReportCollection();
<font color= "blue"></font>
<font color= "blue">            </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue">            </font>{
<font color= "blue">                </font>TabularReport item = new TabularReport();
<font color= "blue">                </font>item.CategoryID = Convert.ToInt32(row["CategoryID"]);
<font color= "blue">                </font>item.CategoryName = row["CategoryName"].ToString();
<font color= "blue">                </font>item.TotalInStock = Convert.ToInt32(row["TotalInStock"]);
<font color= "blue"></font>
<font color= "blue">                </font>items.Add(item);
<font color= "blue">            </font>}
<font color= "blue"></font>
<font color= "blue">            return</font> items;
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // GetProducts method retrieves all product details for the specified  </font>
<font color= "green">        // category from the database and transforms the result </font>
<font color= "green">        // to a TabularReportCollection custom colletion before returning it to </font>
<font color= "green">        // the calling function.</font>
<font color= "green">        //</font>
<font color= "green">        // This method is used to get detail information for each category in </font>
<font color= "green">        // Tabular Report.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        public </font>static TabularReportCollection GetProducts(int categoryID)
<font color= "blue">        </font>{
<font color= "blue">            </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetProductsByCategory", categoryID);
<font color= "blue">            </font>TabularReportCollection items = new TabularReportCollection();
<font color= "blue"></font>
<font color= "blue">            </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue">            </font>{
<font color= "blue">                </font>TabularReport item = new TabularReport();
<font color= "blue">                </font>item.CategoryID = Convert.ToInt32(row["CategoryID"]);
<font color= "blue">                </font>item.ProductName = row["ProductName"].ToString();
<font color= "blue">                </font>item.QuantityPerUnit = row["QuantityPerUnit"].ToString();
<font color= "blue">                </font>item.UnitsInStock = Convert.ToInt32(row["UnitsInStock"]);
<font color= "blue">                </font>item.UnitPrice = Convert.ToDecimal(row["UnitPrice"]);
<font color= "blue"></font>
<font color= "blue">                </font>items.Add(item);
<font color= "blue">            </font>}
<font color= "blue">            return</font> items;
<font color= "blue">        </font>}
<font color= "blue">    </font>}
<font color= "blue"></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

About the Author

idepaula
Web Developer
Uruguay Uruguay
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140718.1 | Last Updated 1 Oct 2005
Article Copyright 2005 by idepaula
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid