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

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 DrillDownReport
	{
		private string		_customerID;
		private string		_companyName;
		private string		_contactName;
		private string		_shipAddress;
		private string		_shipCity;
		private string		_shipCountry;
		private string		_shipPostalCode;
		private DateTime	_orderDate;
		private int			_orderID;
		private DateTime	_shippedDate;
		private int			_productID;
		private string		_productName;
		private decimal		_unitPrice;
		private int 		_quantity;

		public string CustomerID
		{
			get { return _customerID; }
			set { _customerID = value; }
		}

		public string CompanyName
		{
			get { return _companyName; }
			set { _companyName = value; }
		}

		public string ContactName
		{
			get { return _contactName; }
			set { _contactName = value; }
		}

		public string ShipAddress
		{
			get { return _shipAddress; }
			set { _shipAddress = value; }
		}

		public string ShipCity
		{
			get { return _shipCity; }
			set { _shipCity = value; }
		}

		public string ShipCountry
		{
			get { return _shipCountry; }
			set { _shipCountry = value; }
		}

		public string ShipPostalCode
		{
			get { return _shipPostalCode; }
			set { _shipPostalCode = value; }
		}

		public DateTime OrderDate
		{
			get { return _orderDate; }
			set { _orderDate = value; }
		}

		public int OrderID
		{
			get { return _orderID; }
			set { _orderID = value; }
		}

		public DateTime ShippedDate
		{
			get { return _shippedDate; }
			set { _shippedDate = value; }
		}

		public int ProductID
		{
			get { return _productID; }
			set { _productID = value; }
		}

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

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

		public int Quantity
		{
			get { return _quantity; }
			set { _quantity = value; }
		}

		//*********************************************************************
		//
		// GetCustomers method
		//
		// The GetCustomers method retrieves all customers in the Reports database 
		//
		//*********************************************************************

		public static DrillDownReportCollection GetCustomers()
		{
			DataSet dsData = SqlHelper.ExecuteDataset(
				ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetAllCustomers");
			DrillDownReportCollection items = new DrillDownReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				DrillDownReport item = new DrillDownReport();
				item.CustomerID = row["CustomerID"].ToString();
				item.CompanyName = row["CompanyName"].ToString();
				item.ContactName = row["ContactName"].ToString();
				items.Add(item);
			}

			return items;
		}

		//*********************************************************************
		//
		// GetOrders method
		//
		// The GetOrders method retrieves all orders shipped for a particular customer.
		//
		//*********************************************************************

		public static DrillDownReportCollection GetOrders(string customerID)
		{
			DataSet dsData = SqlHelper.ExecuteDataset(
				ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetOrders", customerID);
			DrillDownReportCollection items = new DrillDownReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				DrillDownReport item = new DrillDownReport();
				item.OrderID = Convert.ToInt32(row["OrderID"]);
				item.OrderDate = Convert.ToDateTime(row["OrderDate"]);
				item.ShippedDate = Convert.ToDateTime(row["ShippedDate"]);
				item.ShipAddress = row["ShipAddress"].ToString();
				item.ShipCity = row["ShipCity"].ToString();
				item.ShipCountry = row["ShipCountry"].ToString();
				item.ShipPostalCode = row["ShipPostalCode"].ToString();
				items.Add(item);
			}

			return items;
		}

		//*********************************************************************
		//
		// GetOrderDetails method
		//
		// The GetOrderDetails method retrieves the order info for order with orderID.
		//
		//*********************************************************************

		public static DrillDownReportCollection GetOrderDetails(int orderID)
		{

			DataSet dsData = SqlHelper.ExecuteDataset(
				ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetOrderDetails", orderID);
			DrillDownReportCollection items = new DrillDownReportCollection();

			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				DrillDownReport item = new DrillDownReport();
				item.ProductID = Convert.ToInt32(row["ProductID"]);
				item.ProductName = row["ProductName"].ToString();
				item.UnitPrice = Convert.ToDecimal(row["UnitPrice"]);
				item.Quantity = Convert.ToInt32(row["Quantity"]);
				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

Share

About the Author

StylezHouse
Web Developer
United States United States
No Biography provided

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