Click here to Skip to main content
11,482,039 members (66,528 online)
Click here to Skip to main content
Add your own
alternative version

Conversion of Reporting Starter Kit to use Mono/MySQL

, 1 Oct 2005 23.5K 375 32
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><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
&lt%@ Page language="c#"%<font color= "blue">&gt</font>
&lt%@ Import Namespace="System" %<font color= "blue">&gt</font>
&lt%@ Import Namespace="System.Web.UI.WebControls" %<font color= "blue">&gt</font>
&lt%@ Import Namespace="System.Text" %<font color= "blue">&gt</font>
&lt%@ Import Namespace="ASPNET.StarterKit.Reports.Components" %<font color= "blue">&gt</font>

<font color= "blue">&lt</font><font color="maroon">script</font> runat="server"<font color= "blue">&gt</font>
<font color= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // Visual.aspx</font>
<font color= "green">    //</font>
<font color= "green">    // The Visual.aspx page shows Sales by Category in three different views: </font>
<font color= "green">    // Pie Chart, Bar Graph, and Tabular view.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    protected </font>bool printVersion;
<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>printVersion = Request.QueryString["Print"]=="true";
<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><font color= "blue">            if </font>(Session["ViewSelectIndex"] != null)<font color= "blue"></font>
<font color= "blue">                </font>drpChartType.SelectedIndex = (int)Session["ViewSelectIndex"];
<font color= "blue"></font>
<font color= "green">            // call event to display default view</font>
<font color= "blue">            </font>drpChartType_SelectedIndexChanged(this, new System.EventArgs());
<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>(printVersion)<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= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // The BindGrid method retrieves the list of sales by category</font>
<font color= "green">    // and then databinds them to the SalesByCategoryGrid</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    private void</font> BindGrid(VisualReportCollection data)
<font color= "blue">    </font>{
<font color= "blue">        </font>SalesByCategoryGrid.Visible = true;
<font color= "blue">        </font>SalesByCategoryGrid.DataSource = data;
<font color= "blue">        </font>SalesByCategoryGrid.DataBind();
<font color= "blue">    </font>}
<font color= "blue"></font>
<font color= "green">    //*********************************************************************</font>
<font color= "green">    //</font>
<font color= "green">    // The drpChartType_SelectedIndexChanged event handler gets the sales data and changes the view.</font>
<font color= "green">    //</font>
<font color= "green">    //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    private void</font> drpChartType_SelectedIndexChanged(object sender, System.EventArgs e)
<font color= "blue">    </font>{
<font color= "green">        // retrieve the sales data </font>
<font color= "blue">        </font>VisualReportCollection visualReport = VisualReport.GetCategorySales();
<font color= "blue">            </font>
<font color= "blue"></font><font color= "blue">        if </font>(drpChartType.SelectedItem.Value != "Table")<font color= "blue"></font>
<font color= "blue">        </font>{
<font color= "blue">            </font>StringBuilder xValues = new StringBuilder();
<font color= "blue">            </font>StringBuilder yValues = new StringBuilder();
<font color= "blue">            </font>int rowCount = visualReport.Count;
<font color= "blue">            </font>int i = 1;
<font color= "blue"></font>
<font color= "green">            // convert data to comma delimited stringbuilders</font>
<font color= "blue">            </font>foreach (VisualReport dr in visualReport)
<font color= "blue">            </font>{
<font color= "blue">                </font>xValues.Append(dr.CategoryName);
<font color= "blue">                </font>yValues.Append(dr.Sales);
<font color= "blue"></font><font color= "blue">                if </font>(i < rowCount)<font color= "blue"></font>
<font color= "blue">                </font>{
<font color= "blue">                    </font>xValues.Append("|");
<font color= "blue">                    </font>yValues.Append("|");
<font color= "blue">                </font>}
<font color= "blue">                </font>i++;
<font color= "blue">            </font>}
<font color= "blue"></font>
<font color= "green">            // attach image generator to image</font>
<font color= "blue">            </font>ChartImage.ImageUrl = "ChartGenerator.aspx?" +
<font color= "blue">                </font>"xValues=" + xValues.ToString() + 
<font color= "blue">                </font>"&yValues=" + yValues.ToString() + 
<font color= "blue">                </font>"&ChartType=" + drpChartType.SelectedItem.Value.ToLower()+
<font color= "blue">                </font>"&Print=" + printVersion.ToString();
<font color= "blue">            </font>
<font color= "blue">            </font>ChartImage.Visible = true;
<font color= "blue">            </font>SalesByCategoryGrid.Visible = false;
<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>BindGrid(visualReport);
<font color= "blue">            </font>ChartImage.Visible = false;
<font color= "blue">        </font>}
<font color= "blue"></font>
<font color= "blue">        </font>Session["ViewSelectIndex"] = drpChartType.SelectedIndex;
<font color= "blue">    </font>}
<font color= "blue">&lt/</font><font color="maroon">script</font><font color= "blue">&gt</font>

<font color= "blue">&lt!</font><font color="maroon">doctype</font> html public "-//w3c//dtd html 4.0 transitional//en" <font color= "blue">&gt</font>
<font color= "blue">&lt</font><font color="maroon">html</font><font color= "blue">&gt</font>
    <font color= "blue">&lt</font><font color="maroon">head</font><font color= "blue">&gt</font>
        <font color= "blue">&lt</font><font color="maroon">title</font><font color= "blue">&gt</font>Visual<font color= "blue">&lt/</font><font color="maroon">title</font><font color= "blue">&gt</font>
        <font color= "blue">&lt</font><font color="maroon">meta</font> name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"<font color= "blue">&gt</font>
        <font color= "blue">&lt</font><font color="maroon">link</font> href="&lt%= _styleSheet %<font color= "blue">&gt</font>" type=text/css rel=stylesheet<font color= "blue">&gt</font>
        <font color= "blue">&lt</font><font color="maroon">script</font> src="scripts.js"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">script</font><font color= "blue">&gt</font>
    <font color= "blue">&lt/</font><font color="maroon">head</font><font color= "blue">&gt</font>
    <font color= "blue">&lt</font><font color="maroon">body</font> class="Report" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"<font color= "blue">&gt</font>
        <font color= "blue">&lt</font><font color="maroon">form</font> id="Visual" method="post" runat="server"<font color= "blue">&gt</font>
            <font color= "blue">&lt</font><font color="maroon">table</font> border="0" cellspacing="15" cellpadding="5" width="100%" id="Table1"<font color= "blue">&gt</font>
                <font color= "blue">&lt</font><font color="maroon">tr</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt</font><font color="maroon">td</font> colspan="1" class="ReportTitle"<font color= "blue">&gt</font>Sales By Category<font color= "blue">&lt/</font><font color="maroon">td</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt</font><font color="maroon">td</font> align="right"<font color= "blue">&gt</font>
                        <font color= "blue">&lt</font><font color=blue>asp:hyperlink id="PrintButton" navigateurl="javascript:Print()" cssclass="printbutton" runat="server" visible="False"<font color= "blue">&gt</font>Print<font color= "blue">&lt/</font>asp:hyperlink</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt/</font><font color="maroon">td</font><font color= "blue">&gt</font>

                <font color= "blue">&lt/</font><font color="maroon">tr</font><font color= "blue">&gt</font>
                <font color= "blue">&lt</font><font color="maroon">tr</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt</font><font color="maroon">td</font> colspan="2" class="Select"<font color= "blue">&gt</font>
                        Select View:
                        <font color= "blue">&lt</font><font color=blue>asp:dropdownlist id="drpChartType" OnSelectedIndexChanged="drpChartType_SelectedIndexChanged" runat="server" autopostback="True"</font><font color= "blue">&gt</font>
                            <font color= "blue">&lt</font><font color=blue>asp:listitem value="Pie"<font color= "blue">&gt</font>Pie Chart<font color= "blue">&lt/</font>asp:listitem</font><font color= "blue">&gt</font>
                            <font color= "blue">&lt</font><font color=blue>asp:listitem value="Bar"<font color= "blue">&gt</font>Bar Graph<font color= "blue">&lt/</font>asp:listitem</font><font color= "blue">&gt</font>
                            <font color= "blue">&lt</font><font color=blue>asp:listitem value="Table"<font color= "blue">&gt</font>Table<font color= "blue">&lt/</font>asp:listitem</font><font color= "blue">&gt</font>
                        <font color= "blue">&lt/</font><font color=blue>asp:dropdownlist</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt/</font><font color="maroon">td</font><font color= "blue">&gt</font>
                <font color= "blue">&lt/</font><font color="maroon">tr</font><font color= "blue">&gt</font>
                <font color= "blue">&lt</font><font color="maroon">tr</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt</font><font color="maroon">td</font> colspan="2" valign="top"<font color= "blue">&gt</font>
                        <font color= "blue">&lt</font><font color=blue>asp:datagrid id="SalesByCategoryGrid" runat="server" gridlines="Both" borderwidth="0" showfooter="True" autogeneratecolumns="False" width="300" cellpadding="3" cssclass="Content"</font><font color= "blue">&gt</font>
                            <font color= "blue">&lt</font><font color="maroon">columns</font><font color= "blue">&gt</font>
                                <font color= "blue">&lt</font><font color=blue>asp:boundcolumn datafield="CategoryName" headertext="Category"</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">headerstyle</font> cssclass="HeaderStyle"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">headerstyle</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">itemstyle</font> cssclass="ItemStyle"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">itemstyle</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">footerstyle</font> cssclass="FooterStyle"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">footerstyle</font><font color= "blue">&gt</font>
                                <font color= "blue">&lt/</font><font color=blue>asp:boundcolumn</font><font color= "blue">&gt</font>
                                <font color= "blue">&lt</font><font color=blue>asp:boundcolumn datafield="Sales" headertext="Sales" dataformatstring="{0:c}"</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">headerstyle</font> horizontalalign="Right" cssclass="HeaderStyleRight"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">headerstyle</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">itemstyle</font> cssclass="ItemStyleRight"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">itemstyle</font><font color= "blue">&gt</font>
                                    <font color= "blue">&lt</font><font color="maroon">footerstyle</font> cssclass="FooterStyleRight"<font color= "blue">&gt</font><font color= "blue">&lt/</font><font color="maroon">footerstyle</font><font color= "blue">&gt</font>
                                <font color= "blue">&lt/</font><font color=blue>asp:boundcolumn</font><font color= "blue">&gt</font>
                            <font color= "blue">&lt/</font><font color="maroon">columns</font><font color= "blue">&gt</font>
                        <font color= "blue">&lt/</font><font color=blue>asp:datagrid</font><font color= "blue">&gt</font>
                        <font color= "blue">&lt</font><font color=blue>asp:image id="ChartImage" runat="server" visible="False" borderwidth="0"<font color= "blue">&gt</font><font color= "blue">&lt/</font>asp:image</font><font color= "blue">&gt</font>
                    <font color= "blue">&lt/</font><font color="maroon">td</font><font color= "blue">&gt</font>
                <font color= "blue">&lt/</font><font color="maroon">tr</font><font color= "blue">&gt</font>
            <font color= "blue">&lt/</font><font color="maroon">table</font><font color= "blue">&gt</font>
        <font color= "blue">&lt/</font><font color="maroon">form</font><font color= "blue">&gt</font>
    <font color= "blue">&lt/</font><font color="maroon">body</font><font color= "blue">&gt</font>
<font color= "blue">&lt/</font><font color="maroon">html</font><font color= "blue">&gt</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

StylezHouse
Web Developer
United States United States
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 1 Oct 2005
Article Copyright 2005 by StylezHouse
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid