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
<html>
	<head>
		<title>ASP.NET Reporting Documentation</title>
		<link rel="stylesheet" href="../style.css">
	</head>
	<body class="NormalIndent">
		<h1>
			MasterDetail.aspx Page
		</h1>
		<p>
			<b>Description:</b> &nbsp;&nbsp;The Master Detail page displays a list of 
			orders filtered by year and optionally by quarter. It provides a summary 
			breakdown by quarter as well as a more detailed list of all orders for the year 
			and quarter.
		</p>
		<p>
			<strong>Overview:</strong> &nbsp;&nbsp;This reports show a simple way of 
			creating and databinding two different <strong>DataGrids</strong> on the same 
			page, one for the summary and one for the details. Both DataGrids are bound to 
			two separate stored procedures. For the summary, the results are filtered by 
			year. For the details,&nbsp;the results are filtered by year and quarter 
			(optional).
		</p>
		<P>
			The summary breaks down the number of orders shipped and the amount of sales by 
			quarter. The <strong>Sales Total</strong> for the year is reported at the 
			bottom of the summary.
		</P>
		<p>
			<img src="../images/1x1.gif" width="25"> <img src="../images/masterdetailsummary.png">
		</p>
		<p>
			The detail displays a list of all the orders for the year and quarter 
			(optional), reporting on it's Order ID, Order Date, and Sales amount.
		</p>
		<p>
			<img src="../images/1x1.gif" width="25"> <img src="../images/masterdetaildetails.png">
		</p>
		<p>
			The user can specify the year and quarter by selecting them from the <strong>YearDropDownList</strong>
			and <strong>QuarterDropDownList</strong> at the top of the page.
		</p>
		<p>
			<strong>Implementation Notes:&nbsp;</strong> &nbsp;&nbsp; Two separate 
			DataGrids are created and binded to two separate stored procedures named 
			GetOrderSummary and GetOrderDetails. This is done by calling GetSales and 
			GetSalesDetails in the MasterDetail component in the Business Logic Layer, 
			which will utilize the SQLHelper (DAAB)&nbsp;component in the Data Access 
			Layer. Note that the <strong>YearDropDownList</strong> is used to pass in the 
			year which the results are filtered by.
		</p>
		<pre>
	<font color=blue>private void</font> BindSummary()
	{
		SummaryLabel.Text = YearDropDownList.SelectedItem.Text + " Summary";
		SummaryDataGrid.DataSource = GetSales(Convert.ToInt32(YearDropDownList.SelectedItem.Value));
		SummaryDataGrid.DataBind();
	}

	<font color=blue>protected</font> MasterDetailReportCollection GetSales(<font color=blue>int</font> year)
	{
		<font color=blue>return</font> MasterDetailReport.GetSummary(year);
	}		
		</pre>
		<p>
			In order to calculate the <strong>Sales Total</strong> , an event handler is 
			added to the Summary DataGrid. We iterate thru the DataGrid's list of table 
			rows. We use the third cell in each row, which represents the <strong>Sales</strong>
			column, to calculate the sales total. This total is then added back to the 
			actual DataGrid's footer row.
		</p>
		<pre>
	<font color=blue>private void</font> SumItems(<font color=blue>object</font> sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
	{
		<font color=blue>if</font> (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
		{
			CalcTotal( e.Item.Cells[2].Text );
			e.Item.Cells[2].Text = <font color=blue>string</font>.Format("{0:c}", Convert.ToDouble(e.Item.Cells[2].Text));
		}
		<font color=blue>else if</font> (e.Item.ItemType == ListItemType.Footer )
		{
			e.Item.Cells[0].Text="Sales Total";
			e.Item.Cells[2].Text = <font color=blue>string</font>.Format("{0:c}", _salesTotal);
		}
	}

	<font color=blue>private void</font> CalcTotal(<font color=blue>string</font> _price)
	{
		_salesTotal += Double.Parse(_price);
	} 
		</pre>
	</body>
</html>

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
Web03 | 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