Click here to Skip to main content
13,092,862 members (72,309 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads

Stats

46K views
15 bookmarked
Posted 30 Sep 2005

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
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">    // CrossTab.aspx</font>
<font color= "green">    //</font>
<font color= "green">    // The CrossTab.aspx page shows quarterly breakdown of sales based on the region.</font>
<font color= "green">    // It also displays the totals for each region, the totals for each month within the quarter,</font>
<font color= "green">    // and the total for the whole quarter.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    public class</font> CrossTab : System.Web.UI.Page
<font color= "blue">    </font>{
<font color= "blue">        protected </font>System.Web.UI.WebControls.DataList QuartersList;
<font color= "blue">        protected </font>System.Web.UI.WebControls.DropDownList YearDropDownList;
<font color= "blue">        protected </font>System.Web.UI.WebControls.HyperLink PrintButton;
<font color= "blue"></font>
<font color= "blue">        private </font>double _eastern = 0;
<font color= "blue">        private </font>double _western = 0;
<font color= "blue">        private </font>double _southern = 0;
<font color= "blue">        private </font>double _northern = 0;
<font color= "blue">        private </font>double _totals = 0;
<font color= "blue">        protected </font>string _styleSheet;
<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.YearDropDownList.SelectedIndexChanged += new System.EventHandler(this.YearDropDownList_SelectedIndexChanged);
<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 simply binds the Datalist with the four quarters</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>QuartersList.DataSource = new int[4] { 1, 2, 3, 4 };
<font color= "blue">            </font>QuartersList.DataBind();
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // The GetQuarterDetails method is set as the DataSource of the inner datagrid.</font>
<font color= "green">        // As the QuartsList is being data-bound, this populates the inner datagrids for the quarters.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected </font>CrossTabReportCollection GetQuarterDetails(int quarter)
<font color= "blue">        </font>{
<font color= "blue">            return</font> CrossTabReport.GetRegionSales(quarter, Convert.ToInt32(YearDropDownList.SelectedItem.Value));
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "green">        //*********************************************************************</font>
<font color= "green">        //</font>
<font color= "green">        // The SumItems event handler is for the OnItemDataBound event of the datagrids for each quarter.</font>
<font color= "green">        // It adds running totals for each region for a particular quarter.</font>
<font color= "green">        // It also adds the sum totals fo the regions of the quarter as well.</font>
<font color= "green">        //</font>
<font color= "green">        //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">        protected void</font> SumItems(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
<font color= "blue">        </font>{
<font color= "green">            // sum up the data in the columns as the datagrid is databinding</font>
<font color= "blue"></font><font color= "blue">            if </font>(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "green">                // get the sales value for eastern region</font>
<font color= "blue">                </font>double eastern = Convert.ToDouble(e.Item.Cells[1].Text);
<font color= "green">                // add sales value to the running total</font>
<font color= "blue">                </font>_eastern += eastern;
<font color= "green">                // format to display sales value as currency</font>
<font color= "blue">                </font>e.Item.Cells[1].Text = string.Format("{0:c}", eastern);
<font color= "blue"></font>
<font color= "blue">                </font>double western = Convert.ToDouble(e.Item.Cells[2].Text);
<font color= "blue">                </font>_western += western;
<font color= "blue">                </font>e.Item.Cells[2].Text = string.Format("{0:c}", western);
<font color= "blue"></font>
<font color= "blue">                </font>double southern = Convert.ToDouble(e.Item.Cells[3].Text);
<font color= "blue">                </font>_southern += southern;
<font color= "blue">                </font>e.Item.Cells[3].Text = string.Format("{0:c}", southern);
<font color= "blue">                </font>
<font color= "blue">                </font>double northern = Convert.ToDouble(e.Item.Cells[4].Text);
<font color= "blue">                </font>_northern += northern;
<font color= "blue">                </font>e.Item.Cells[4].Text = string.Format("{0:c}", northern);
<font color= "blue">                </font>
<font color= "blue">                </font>double totals = Convert.ToDouble(e.Item.Cells[5].Text);
<font color= "blue">                </font>_totals += totals;
<font color= "blue">                </font>e.Item.Cells[5].Text = string.Format("{0:c}", totals);
<font color= "blue">            </font>}
<font color= "blue"></font><font color= "blue">            else if</font>(e.Item.ItemType == ListItemType.Footer )<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "green">                // display our summations in footer</font>
<font color= "blue">                </font>e.Item.Cells[0].Text = "Totals";
<font color= "blue">                </font>e.Item.Cells[0].HorizontalAlign = HorizontalAlign.Left;
<font color= "blue">                </font>e.Item.Cells[1].Text = string.Format("{0:c}", _eastern);
<font color= "blue">                </font>e.Item.Cells[2].Text = string.Format("{0:c}", _western);
<font color= "blue">                </font>e.Item.Cells[3].Text = string.Format("{0:c}", _southern);
<font color= "blue">                </font>e.Item.Cells[4].Text = string.Format("{0:c}", _northern);
<font color= "blue">                </font>e.Item.Cells[5].Text = string.Format("{0:c}", _totals);
<font color= "blue"></font>
<font color= "green">                // reset the running totals for next datagrid</font>
<font color= "blue">                </font>_eastern = 0;
<font color= "blue">                </font>_western = 0;
<font color= "blue">                </font>_southern = 0;
<font color= "blue">                </font>_northern = 0;
<font color= "blue">                </font>_totals = 0;
<font color= "blue">            </font>}
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        private void</font> YearDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "blue">            </font>BindList();
<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

You may also be interested in...

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