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
REPORTS.BKP
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">using</font> System;
<font color= "blue">using</font> System.Web.UI.WebControls;
<font color= "blue">using</font> ASPNET.StarterKit.Reports.Components;
<font color= "blue"></font>
<font color= "blue">namespace</font> ASPNET.StarterKit.Reports
<font color= "blue"></font>{
<font color= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // DrillDown.aspx</font>
<font color= "green">    //</font>
<font color= "green">    // The drilldown report displays customer order info. Users are presented with </font>
<font color= "green">    // a list of customers. From there, they can focus in on a customer and see the</font>
<font color= "green">    // orders shipped to that customer. Then, they can focus in on an order ID to </font>
<font color= "green">    // view the details for a particular order.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    public class</font> DrillDown : System.Web.UI.Page
<font color= "blue">    </font>{
<font color= "blue">        protected </font>System.Web.UI.WebControls.DataList CustomerList;
<font color= "blue">        protected </font>System.Web.UI.WebControls.HyperLink PrintButton;
<font color= "blue">        protected </font>string _styleSheet;
<font color= "blue"></font>
<font color= "blue">        private const </font>string _customerID = "CustomerID";
<font color= "blue">    </font>
<font color= "blue">        private void</font> Page_Load(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "blue"></font><font color= "blue">            if </font>(!IsPostBack)<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "blue">                </font>BindList();
<font color= "blue">            </font>}
<font color= "blue"></font>
<font color= "green">            // switches the style sheet based on printer friendly view or not</font>
<font color= "blue"></font><font color= "blue">            if </font>(Request.QueryString["Print"]=="true")<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "blue">                </font>_styleSheet = "stylesPrint.css";
<font color= "blue">                </font>PrintButton.Visible = true;
<font color= "blue">            </font>}
<font color= "blue"></font><font color= "blue">            else </font><font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "blue">                </font>_styleSheet = "styles.css";
<font color= "blue">            </font>}
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        </font>#region Web Form Designer generated code
<font color= "blue">        </font>override protected void OnInit(EventArgs e)
<font color= "blue">        </font>{
<font color= "green">            //</font>
<font color= "green">            // CODEGEN: This call is required by the ASP.NET Web Form Designer.</font>
<font color= "green">            //</font>
<font color= "blue">            </font>InitializeComponent();
<font color= "blue">            </font>base.OnInit(e);
<font color= "blue">        </font>}
<font color= "blue">        </font>
<font color= "green">        /// <summary></font>
<font color= "green">        /// Required method for Designer support - do not modify</font>
<font color= "green">        /// the contents of this method with the code editor.</font>
<font color= "green">        /// </summary></font>
<font color= "blue">        private void</font> InitializeComponent()
<font color= "blue">        </font>{    
<font color= "blue">            </font>this.Load += new System.EventHandler(this.Page_Load);
<font color= "blue"></font>
<font color= "blue">        </font>}
<font color= "blue">        </font>#endregion
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // The BindList method retrieves the list of customers</font>
<font color= "green">        // and then databinds them to the Customers Datalist</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        private void</font> BindList()
<font color= "blue">        </font>{
<font color= "blue">            </font>CustomerList.DataSource = DrillDownReport.GetCustomers();
<font color= "blue">            </font>CustomerList.DataBind();
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*******************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // DataList_ItemCommand event handler is tied to the OnItemDataBound of the Customers DataList.</font>
<font color= "green">        // It sets the selected index of the Customers List and then re-binds.</font>
<font color= "green">        //</font>
<font color= "green">        //*******************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected void</font> CustomersList_ItemCommand(object Sender, DataListCommandEventArgs e) 
<font color= "blue">        </font>{
<font color= "green">            // change the Datalist to selected index</font>
<font color= "blue">            </font>string cmd = ((LinkButton)e.CommandSource).CommandName;
<font color= "blue"></font><font color= "blue">            if </font>(cmd == "select")<font color= "blue"></font>
<font color= "blue">                </font>((DataList)Sender).SelectedIndex = e.Item.ItemIndex;
<font color= "blue"></font>
<font color= "green">            // re-bind to display data with the new selected index</font>
<font color= "blue">            </font>BindList();
<font color= "blue"></font>
<font color= "green">            // store the customer id to re-bind in the orders list</font>
<font color= "blue">            </font>ViewState[_customerID] = ((Label)e.Item.FindControl("CustomerID")).Text;
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*******************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // OrdersList_ItemCommand event handler is tied to the OnItemDataBound of the Orders DataList.</font>
<font color= "green">        // It sets the selected index of the Orders List and then re-binds.</font>
<font color= "green">        //</font>
<font color= "green">        //*******************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected void</font> OrdersList_ItemCommand(object Sender, DataListCommandEventArgs e) 
<font color= "blue">        </font>{
<font color= "green">            // change the selected index of Orders Datalist</font>
<font color= "blue">            </font>string cmd = ((LinkButton)e.CommandSource).CommandName;
<font color= "blue">            </font>DataList sender = (DataList)Sender;
<font color= "blue"></font><font color= "blue">            if </font>(cmd == "select")<font color= "blue"></font>
<font color= "blue">                </font>sender.SelectedIndex = e.Item.ItemIndex;
<font color= "blue"></font>
<font color= "green">            // re-bind to display orders info with new selected index.</font>
<font color= "blue">            </font>sender.DataSource = GetOrders((string)ViewState[_customerID]);
<font color= "blue">            </font>sender.DataBind();
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // The GetOrders method calls the BLL to retrieve the list of orders shipped</font>
<font color= "green">        // for customer with customerID.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected </font>DrillDownReportCollection GetOrders(string customerID)
<font color= "blue">        </font>{
<font color= "green">            // only use the customerID in session if it doesn't exist.</font>
<font color= "blue"></font><font color= "blue">            if </font>(customerID == null)<font color= "blue"></font>
<font color= "blue">                </font>customerID = (string)ViewState[_customerID];
<font color= "blue"></font>
<font color= "blue">            return</font> DrillDownReport.GetOrders(customerID);
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // The GetOrderDetails method calls the BLL to retrieve order info given an order id.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected </font>DrillDownReportCollection GetOrderDetails(int orderID)
<font color= "blue">        </font>{
<font color= "blue">            return</font> DrillDownReport.GetOrderDetails(orderID);
<font color= "blue">        </font>}
<font color= "blue">    </font>}
<font color= "blue"></font>}
</pre>

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

idepaula
Web Developer
Uruguay Uruguay
No Biography provided

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