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
Go to top

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.Drawing;
<font color= "blue">using</font> System.Drawing.Imaging;
<font color= "blue">using</font> System.IO;
<font color= "blue">using</font> ASPNET.StarterKit.Chart;
<font color= "blue"></font>
<font color= "blue">namespace</font> ASPNET.StarterKit.Reports
<font color= "blue"></font>{
<font color= "green">    /// <summary></font>
<font color= "green">    /// Summary description for ChartGenerator.</font>
<font color= "green">    /// </summary></font>
<font color= "blue">    public class</font> ChartGenerator : System.Web.UI.Page
<font color= "blue">    </font>{
<font color= "blue">        private void</font> Page_Load(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "green">            // set return type to png image format</font>
<font color= "blue">            </font>Response.ContentType = "image/png";
<font color= "blue"></font>
<font color= "blue">            </font>string xValues, yValues, chartType, print;
<font color= "blue">            </font>bool boolPrint;
<font color= "blue"></font>
<font color= "green">            // Get input parameters from query string</font>
<font color= "blue">            </font>chartType = Request.QueryString["chartType"];
<font color= "blue">            </font>xValues = Request.QueryString["xValues"];
<font color= "blue">            </font>yValues = Request.QueryString["yValues"];
<font color= "blue">            </font>print = Request.QueryString["Print"];
<font color= "blue"></font>
<font color= "blue"></font><font color= "blue">            if </font>(chartType == null)<font color= "blue"></font>
<font color= "blue">                </font>chartType = "";
<font color= "blue"></font>
<font color= "green">            // check for printing option </font>
<font color= "blue"></font><font color= "blue">            if </font>(print == null)<font color= "blue"></font>
<font color= "blue">                </font>boolPrint = false;
<font color= "blue"></font><font color= "blue">            else</font><font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "blue">                try</font>
<font color= "blue">                </font>{
<font color= "blue">                    </font>boolPrint = Convert.ToBoolean(print);
<font color= "blue">                </font>}
<font color= "blue">                catch</font>
<font color= "blue">                </font>{
<font color= "blue">                    </font>boolPrint = false;
<font color= "blue">                </font>}
<font color= "blue">            </font>}
<font color= "blue"></font>
<font color= "blue"></font><font color= "blue">            if </font>(xValues != null && yValues != null)<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "blue">                </font>Color bgColor;
<font color= "blue"></font>
<font color= "blue"></font><font color= "blue">                if </font>(boolPrint)<font color= "blue"></font>
<font color= "blue">                    </font>bgColor = Color.White;
<font color= "blue"></font><font color= "blue">                else</font><font color= "blue"></font>
<font color= "blue">                    </font>bgColor = Color.FromArgb(255,253,244);
<font color= "blue"></font>
<font color= "blue">                </font>Bitmap StockBitMap;
<font color= "blue">                </font>MemoryStream memStream = new MemoryStream();
<font color= "blue"></font>
<font color= "blue">                switch</font> (chartType)
<font color= "blue">                </font>{
<font color= "blue">                    case</font> "bar":
<font color= "blue">                        </font>BarGraph bar = new BarGraph(bgColor);
<font color= "blue">                        </font>
<font color= "blue">                        </font>bar.VerticalLabel = "$";
<font color= "blue">                        </font>bar.VerticalTickCount = 5;
<font color= "blue">                        </font>bar.ShowLegend = true;
<font color= "blue">                        </font>bar.ShowData = false;
<font color= "blue">                        </font>bar.Height = 400;
<font color= "blue">                        </font>bar.Width = 700;
<font color= "blue"></font>
<font color= "blue">                        </font>bar.CollectDataPoints(xValues.Split("|".ToCharArray()), yValues.Split("|".ToCharArray()));
<font color= "blue">                        </font>StockBitMap = bar.Draw();
<font color= "blue">                        </font>break;
<font color= "blue">                    </font>default:
<font color= "blue">                        </font>PieChart pc = new PieChart(bgColor);
<font color= "blue">    </font>
<font color= "blue">                        </font>pc.CollectDataPoints(xValues.Split("|".ToCharArray()),yValues.Split("|".ToCharArray()));
<font color= "blue"></font>
<font color= "blue">                        </font>StockBitMap = pc.Draw();
<font color= "blue"></font>
<font color= "blue">                        </font>break;
<font color= "blue">                </font>}
<font color= "blue"></font>
<font color= "green">                // This is a quick check for referrer server name against host server</font>
<font color= "green">                // For best security practice in a deployed application, an authenticating mechanism should be in placed.</font>
<font color= "green">                // Image should only be rendered for authenticated users only.</font>
<font color= "blue"></font><font color= "blue">                if </font>(Request.UrlReferrer != null &&((Request.UrlReferrer.Host.ToLower() == Environment.UserDomainName.ToLower()) <font color= "blue"></font>
<font color= "blue">                    </font>|| Request.UrlReferrer.Host.ToLower() == "localhost"))
<font color= "blue">                </font>{
<font color= "green">                    // Render BitMap Stream Back To Client</font>
<font color= "blue">                    </font>StockBitMap.Save(memStream, ImageFormat.Png);
<font color= "blue">                    </font>memStream.WriteTo(Response.OutputStream);
<font color= "blue">                </font>}
<font color= "blue"></font>
<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>#endregion
<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 | Mobile
Web04 | 2.8.140916.1 | Last Updated 1 Oct 2005
Article Copyright 2005 by idepaula
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid