袁氏报表用代码画一个饼图
2007-06-13 16:45
363 查看
先要建一个ReportService.aspx 代码如下:
XDesigner.Report.ReportHtmlBuilder hb = this.Session["htmlbuilder"] as XDesigner.Report.ReportHtmlBuilder;
if (hb == null)
return;
if (this.Request.QueryString["imageindex"] != null)
if (this.Request.QueryString["out"] == "doc")
else if (this.Request.QueryString["out"] == "xls")
else if (this.Request.QueryString["out"] == "pdf")
else
hb.Save(this.Response.Output);
再建一个页面画大饼咯:
//先增一个报表
DesignReportDocument doc = new DesignReportDocument();
doc.Title = "动态报表";
//Lable
DesignReportLabel lbl = doc.CreateLabelElement();
lbl.Text = "动态报表演示";
lbl.TextColor = System.Drawing.Color.Yellow;
lbl.Font = new Font("宋体", 20, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
lbl.Align = StringAlignment.Center;
lbl.PrintDockStyle = PrintDockStyle.Top;
lbl.Height = 120;
lbl.Border.BackColor = Color.SkyBlue;
doc.Add(lbl);
//一个大饼
DesignReportPie pie = doc.CreatePieElement();
pie.Bounds = new Rectangle(169, 775, 1363, 954);
pie.Thickness = 60;
pie.BorderWidth = 1;
pie.LeftBorder = false;
pie.TopBorder = false;
pie.RightBorder = false;
pie.BottomBorder = false;
doc.Add(pie);
//增加列
for (int i = 1; i < 5; i++)
DesignReportLabelList reportpietext1 = doc.CreateLabelListElement();
doc.AppendChild(reportpietext1);
reportpietext1.ID = "reportpietext1";
reportpietext1.Bounds = new System.Drawing.Rectangle(215, 24, 1175, 731);
reportpietext1.BorderWidth = 1;
reportpietext1.ItemSpacing = 30;
reportpietext1.ItemHeight = 50;
reportpietext1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
reportpietext1.BarSize = 60;
XDesigner.Report.ReportBuilder rb = new ReportBuilder();
rb.LoadReport(doc);
XDesigner.Report.ReportHtmlBuilder hb = rb.CreateHtmlBuilder();
hb.ImgSrcFormatString = "reportservice.aspx?imageindex={0}";
hb.Refresh();
hb.ContentEncoding = this.Response.ContentEncoding;
this.Session["htmlbuilder"] = hb;
hb.Save(this.Response.Output);
XDesigner.Report.ReportHtmlBuilder hb = this.Session["htmlbuilder"] as XDesigner.Report.ReportHtmlBuilder;
if (hb == null)
return;
if (this.Request.QueryString["imageindex"] != null)
if (this.Request.QueryString["out"] == "doc")
else if (this.Request.QueryString["out"] == "xls")
else if (this.Request.QueryString["out"] == "pdf")
else
hb.Save(this.Response.Output);
再建一个页面画大饼咯:
//先增一个报表
DesignReportDocument doc = new DesignReportDocument();
doc.Title = "动态报表";
//Lable
DesignReportLabel lbl = doc.CreateLabelElement();
lbl.Text = "动态报表演示";
lbl.TextColor = System.Drawing.Color.Yellow;
lbl.Font = new Font("宋体", 20, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
lbl.Align = StringAlignment.Center;
lbl.PrintDockStyle = PrintDockStyle.Top;
lbl.Height = 120;
lbl.Border.BackColor = Color.SkyBlue;
doc.Add(lbl);
//一个大饼
DesignReportPie pie = doc.CreatePieElement();
pie.Bounds = new Rectangle(169, 775, 1363, 954);
pie.Thickness = 60;
pie.BorderWidth = 1;
pie.LeftBorder = false;
pie.TopBorder = false;
pie.RightBorder = false;
pie.BottomBorder = false;
doc.Add(pie);
//增加列
for (int i = 1; i < 5; i++)
DesignReportLabelList reportpietext1 = doc.CreateLabelListElement();
doc.AppendChild(reportpietext1);
reportpietext1.ID = "reportpietext1";
reportpietext1.Bounds = new System.Drawing.Rectangle(215, 24, 1175, 731);
reportpietext1.BorderWidth = 1;
reportpietext1.ItemSpacing = 30;
reportpietext1.ItemHeight = 50;
reportpietext1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
reportpietext1.BarSize = 60;
XDesigner.Report.ReportBuilder rb = new ReportBuilder();
rb.LoadReport(doc);
XDesigner.Report.ReportHtmlBuilder hb = rb.CreateHtmlBuilder();
hb.ImgSrcFormatString = "reportservice.aspx?imageindex={0}";
hb.Refresh();
hb.ContentEncoding = this.Response.ContentEncoding;
this.Session["htmlbuilder"] = hb;
hb.Save(this.Response.Output);
相关文章推荐
- 一个将MCRE的物料消耗,CKM3的下层差异接受和CO03的实际成本加工在一个报表的代码
- 一个将MCRE的物料消耗,CKM3的下层差异接受和CO03的实际成本加工在一个报表的代码
- 一个将MCRE的物料消耗,CKM3的下层差异接受和CO03的实际成本加工在一个报表的代码
- 最近项目中有遇到报表数据入库的情况,数据量说大不大,说小又赖得自己手动敲!于是自己动手写了一个入库的,下面直接上代码,如有同样的,请联系我删除此文
- 一个Oracle 报表的PL/SQL代码
- 一个将MCRE的物料消耗,CKM3的下层差异接受和CO03的实际成本加工在一个报表的代码
- 一个将MCRE的物料消耗,CKM3的下层差异接受和CO03的实际成本加工在一个报表的代码
- 一个可以返回前一页并自动刷新页面的ASP代码.
- 使用代码创建一个kbmMemTable数据表
- php的一个简单加密解密代码
- 实验二:完成一个简单的时间片轮转多道程序内核代码
- 如何创建一个水晶报表用户自定义函数库 UFls (Creating a Crystal Reports Custom Function Library)
- 一个请求从 URL 字符串到 HTML 代码的“漫长曲折”之路
- 仿Aspnetpager的一个PHP分页类代码 附源码下载
- HR--一个员工的所有主数据(PA*)克隆到一个新员工的程序代码
- 一个典型的PHP分页实例代码分享
- iOS 一个在UDP/TCP通信时,对16进制、10进制、NSData等数据之间的转换发送等处理的工具类库,一行代码将16进制字符串轻松转换成UDP需要的指令数据
- 趣图:找了一个女同事来 Review 代码
- 一个简单代码的不简单实现
- 只运行一个应用程序的错误代码的分析