Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Conversion of Reporting Starter Kit to use Mono/MySQL

, 1 Oct 2005
A porting of the ASP.NET reporting starter kit to use Mono, MySQL and Apache on a Linux system.
Reporting_Kit_Conversion_demo.zip
reports
bin
ASPNETReports.dll
ASPNETReports.dll.bak
MySql.Data.dll
MySql.Data.Tests.dll
components
bin
Release
ASPNETReports.dll
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
tabcolorcode.png
tabdetail.png
tabheader.gif
tabheader.png
tabnestedcontrols.png
tabsortshot.png
tabularextendedprice.png
textshot.gif
viscategorysales.gif
viscategorysales.png
vischartstructure.png
xtabsql.png
Global.asax
images
1x1.gif
asp.net-reports.gif
background.gif
crosstab.gif
crosstabnestedcontrols.png
crosstabtotals.png
customers.gif
drilldown.gif
drilldownnestedcontrols.png
employees.gif
getorderdetails.gif
GetOrders.gif
grid_background.gif
hierarchal.gif
hierarchical.gif
hierarchicalpaging.gif
hierarchicalreport.gif
hierarchicalschema.gif
hierarchicalsorting.gif
logo-neg.gif
logo.gif
masterdetail.gif
masterdetaildetails.png
masterdetails.gif
masterdetailsummary.png
masterdetailtables.png
matrix.gif
querysample.gif
querysample2.gif
report-table-bg.gif
reporting.gif
simple.gif
simpleoverview.png
simplesp.png
spacer.gif
tabcolorcode.png
tabdetail.png
tabheader.gif
tabheader.png
tabnestedcontrols.png
tabsortshot.png
tabular.gif
tabularcolorcode.png
tabularextendedprice.png
tabularsorting.png
text.gif
textalternate.gif
textreport.gif
textshot.gif
viscategorysales.gif
viscategorysales.png
vischartstructure.png
visual.gif
xtabsql.png
sourceviewer
1x1.gif
crosstab.src
drilldown.src
grid_background.gif
hierarchical.src
masterdetail.src
simple.src
tabular.src
textreport.src
visual.src
sql
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.Reports.DataAccessLayer;
using System.Collections;

namespace ASPNET.StarterKit.Reports.Components
{
	public class HierarchicalReport
	{
		private string		_territoryDescription;
		private decimal		_salesTotals;
		private int			_employeeID;
		private string		_employeeName;
		private string		_employeeTitle;
		private string		_employeeAddress;
		private string		_employeeCity;
		private string		_employeeRegion;
		private string		_employeePostalCode;
		private string		_employeeCountry;
		private string		_employeePhone;

		public string TerritoryDescription
		{
			get { return _territoryDescription; }
			set { _territoryDescription = value; }
		}

		public decimal SalesTotals
		{
			get { return _salesTotals; }
			set { _salesTotals = value; }
		}

		public int EmployeeID
		{
			get { return _employeeID; }
			set { _employeeID = value; }
		}

		public string EmployeeName
		{
			get { return _employeeName; }
			set { _employeeName = value; }
		}

		public string EmployeeTitle
		{
			get { return _employeeTitle; }
			set { _employeeTitle = value; }
		}
		
		public string EmployeeAddress
		{
			get { return _employeeAddress; }
			set { _employeeAddress = value; }
		}
		
		public string EmployeeCity
		{
			get { return _employeeCity; }
			set { _employeeCity = value; }
		}
		
		public string EmployeeRegion
		{
			get { return _employeeRegion; }
			set { _employeeRegion = value; }
		}
		
		public string EmployeePostalCode
		{
			get { return _employeePostalCode; }
			set { _employeePostalCode = value; }
		}

		public string EmployeeCountry
		{
			get { return _employeeCountry; }
			set { _employeeCountry = value; }
		}

		public string EmployeePhone
		{
			get { return _employeePhone; }
			set { _employeePhone = value; }
		}

		//*********************************************************************
		//
		// GetSalesByTerritory()
		//
		// This function calls the "GetSalesByTerritory" which retrieves the
		// sales totals for 1996, 1997, and 1998, grouped by Territory.
		// The items are added to the Array List and returned in the custom
		// thin class HierarchicalReportCollection.
		//
		//*********************************************************************

		public static HierarchicalReportCollection GetSalesByTerritory(int year)
		{
			DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetSalesByTerritory", year);
			HierarchicalReportCollection items = new HierarchicalReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				HierarchicalReport item = new HierarchicalReport();
				item.TerritoryDescription = row["TerritoryDescription"].ToString();

				// Check for nulls, as they may not have any sales for this period
				if(row["SalesTotals"] != System.DBNull.Value)
					item.SalesTotals = Convert.ToDecimal(row["SalesTotals"]);

				items.Add(item);
			}

			return items;
		}
		
		//*********************************************************************
		//
		// GetEmployeeSalesByTerritory()
		//
		// This function calls the "GetSalesByTerritory" which retrieves the
		// sales totals for 1996, 1997, and 1998, grouped by Employee, for
		// a particular Territory.
		//
		// The items are added to the Array List and returned in the custom
		// thin class HierarchicalReportCollection.
		//
		//*********************************************************************

		public static HierarchicalReportCollection GetEmployeeSalesByTerritory(string TerritoryName, int year)
		{
			DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetEmployeeSalesByTerritory", TerritoryName, year);
			HierarchicalReportCollection items = new HierarchicalReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				HierarchicalReport item = new HierarchicalReport();
				item.EmployeeID = Convert.ToInt32(row["EmployeeID"]);
				item.EmployeeName = row["EmployeeName"].ToString();

				// Check for nulls, as they may not have any sales for this period
				if(row["SalesTotals"] != System.DBNull.Value)
					item.SalesTotals = Convert.ToDecimal(row["SalesTotals"]);

				items.Add(item);
			}

			return items;
		}

		//*********************************************************************
		//
		// GetEmployeeInfo()
		//
		// This function calls the "GetSalesByTerritory" which retrieves the
		// sales totals for 1996, 1997, and 1998, grouped by Employee, for
		// a particular Territory.
		//
		// The items are added to the Array List and returned in the custom
		// thin class HierarchicalReportCollection.
		//
		//*********************************************************************

		public static HierarchicalReportCollection GetEmployeeInfo(int employeeID)
		{
			DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetEmployeeByID", employeeID);
			HierarchicalReportCollection items = new HierarchicalReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				HierarchicalReport item = new HierarchicalReport();
				item.EmployeeID = Convert.ToInt32(row["EmployeeID"]);
				item.EmployeeTitle = row["Title"].ToString();
				item.EmployeeAddress = row["Address"].ToString();
				item.EmployeeCity = row["City"].ToString();
				item.EmployeeRegion = row["Region"].ToString();
				item.EmployeePostalCode = row["PostalCode"].ToString();
				item.EmployeeCountry = row["Country"].ToString();
				item.EmployeePhone = row["HomePhone"].ToString();

				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

StylezHouse
Web Developer
United States United States
No Biography provided

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