- reporting_kit_conversion_demo.zip
- reports
- bin
- ASPNETReports.dll
- ASPNETReports.dll.bak
- MySql.Data.dll
- MySql.Data.Tests.dll
- MySql.Data.xml
- ChartGenerator.aspx
- components
- crosstab.aspx
- default.aspx
- docs
- drilldown.aspx
- Global.asax
- hierarchical.aspx
- 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.gif
- logo-neg.gif
- masterdetail.gif
- masterdetaildetails.png
- masterdetails.gif
- masterdetailsummary.png
- masterdetailtables.png
- matrix.gif
- querysample.gif
- querysample2.gif
- reporting.gif
- report-table-bg.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
- masterdetail.aspx
- scripts.js
- simplereport.aspx
- sourceviewer
- 1x1.gif
- crosstab.src
- drilldown.src
- grid_background.gif
- hierarchical.src
- masterdetail.src
- simple.src
- srcview.aspx
- style.css
- tabular.src
- tabview.aspx
- textreport.src
- visual.src
- sql
- styles.css
- stylesPrint.css
- tabular.aspx
- textreport.aspx
- visual.aspx
- web.config
|
<%@ Page language="c#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="ASPNET.StarterKit.Chart" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
// This is a quick check for referrer server name against host server
// For best security practice in a deployed application, an authenticating mechanism should be in placed.
// Image should only be rendered for authenticated users only.
if (Request.UrlReferrer != null &&((Request.UrlReferrer.Host.ToLower() == Environment.UserDomainName.ToLower())
|| Request.UrlReferrer.Host.ToLower() == "localhost"))
{
// set return type to png image format
Response.ContentType = "image/png";
string xValues, yValues, chartType, print;
bool boolPrint;
// Get input parameters from query string
chartType = Request.QueryString["chartType"];
xValues = Request.QueryString["xValues"];
yValues = Request.QueryString["yValues"];
print = Request.QueryString["Print"];
if (chartType == null)
chartType = "";
// check for printing option
if (print == null)
boolPrint = false;
else
{
try
{
boolPrint = Convert.ToBoolean(print);
}
catch
{
boolPrint = false;
}
}
if (xValues != null && yValues != null)
{
Color bgColor;
if (boolPrint)
bgColor = Color.White;
else
bgColor = Color.FromArgb(255,253,244);
Bitmap StockBitMap;
MemoryStream memStream = new MemoryStream();
switch (chartType)
{
case "bar":
BarGraph bar = new BarGraph(bgColor);
bar.VerticalLabel = "$";
bar.VerticalTickCount = 5;
bar.ShowLegend = true;
bar.ShowData = false;
bar.Height = 400;
bar.Width = 700;
bar.CollectDataPoints(xValues.Split("|".ToCharArray()), yValues.Split("|".ToCharArray()));
StockBitMap = bar.Draw();
break;
default:
PieChart pc = new PieChart(bgColor);
pc.CollectDataPoints(xValues.Split("|".ToCharArray()),yValues.Split("|".ToCharArray()));
StockBitMap = pc.Draw();
break;
}
// Render BitMap Stream Back To Client
StockBitMap.Save(memStream, ImageFormat.Png);
memStream.WriteTo(Response.OutputStream);
}
}
}
</script>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en" >
<html>
<head>
<title>ChartGenerator</title>
<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body ms_positioning="GridLayout">
<form id="ChartGenerator" method="post" runat="server">
</form>
</body>
</html>
|
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.
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
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.