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.gif
logo-neg.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
REPORTS.BKP
|
<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> 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> 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, 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: </strong> 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) 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 use 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.
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