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
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.Reports.DataAccessLayer;
using System.Collections;

namespace ASPNET.StarterKit.Reports.Components
{
	//*********************************************************************
	//
	// TabularReport Class
	//
	// The TabularReport class is used to represent a data item for Tabular 
	// Report and is mainly used to retrieve data from the database.
	//
	//*********************************************************************

	public class TabularReport
	{
		private int			_categoryID;
		private string		_categoryName;
		private string		_productName;
		private string		_quantityPerUnit;
		private int			_totalInStock;
		private decimal		_unitPrice;
		private int			_unitsInStock;
		
		public int CategoryID
		{
			get { return _categoryID; }
			set { _categoryID = value; }
		}

		public string CategoryName
		{
			get { return _categoryName; }
			set { _categoryName = value; }
		}

		public string ProductName
		{
			get { return _productName; }
			set { _productName = value; }
		}

		public string QuantityPerUnit
		{
			get { return _quantityPerUnit; }
			set { _quantityPerUnit = value; }
		}

		public int TotalInStock
		{
			get { return _totalInStock; }
			set { _totalInStock = value; }
		}

		public decimal UnitPrice
		{
			get { return _unitPrice; }
			set { _unitPrice = value; }
		}

		public int UnitsInStock
		{
			get { return _unitsInStock; }
			set { _unitsInStock = value; }
		}

		//*********************************************************************
		//
		// GetCategories method retrieves all available category names with total 
		// unit in stock information from the database and transforms the result 
		// to a TabularReportCollection custom colletion before returning it to 
		// the calling function.
		//
		// This method is called to get header information for the Tabular Report.
		//
		//*********************************************************************

		public static TabularReportCollection GetCategories()
		{
			DataSet dsData = DatabaseHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetCategories");
			TabularReportCollection items = new TabularReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				TabularReport item = new TabularReport();
				item.CategoryID = Convert.ToInt32(row["CategoryID"]);
				item.CategoryName = row["CategoryName"].ToString();
				item.TotalInStock = Convert.ToInt32(row["TotalInStock"]);

				items.Add(item);
			}

			return items;
		}

		//*********************************************************************
		//
		// GetProducts method retrieves all product details for the specified  
		// category from the database and transforms the result 
		// to a TabularReportCollection custom colletion before returning it to 
		// the calling function.
		//
		// This method is used to get detail information for each category in 
		// Tabular Report.
		//
		//*********************************************************************

		public static TabularReportCollection GetProducts(int categoryID)
		{
			DataSet dsData = DatabaseHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetProductsByCategory", categoryID);
			TabularReportCollection items = new TabularReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				TabularReport item = new TabularReport();
				item.CategoryID = Convert.ToInt32(row["CategoryID"]);
				item.ProductName = row["ProductName"].ToString();
				item.QuantityPerUnit = row["QuantityPerUnit"].ToString();
				item.UnitsInStock = Convert.ToInt32(row["UnitsInStock"]);
				item.UnitPrice = Convert.ToDecimal(row["UnitPrice"]);

				items.Add(item);
			}
			return items;
		}
	}
}

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
Web02 | 2.8.140709.1 | Last Updated 1 Oct 2005
Article Copyright 2005 by idepaula
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid