水晶报表asp.net的webform下基本用法实例
本文实例讲述了水晶报表asp.net的webform下基本用法。分享给大家供大家参考。
具体实现方法如下:
{
ConfigureCrystalReport();
}
protected void Page_Unload(object sender, EventArgs e)
{
if (rptDocument == null)
return;
rptDocument.Close();
rptDocument.Dispose();
}
private void ConfigureCrystalReport()
{
string temp = BusinessObject.Util.Decrypt(Request.QueryString["toid"]);
TourOrderId = Util.ConvertTo<int>(temp, 0);
if (ViewState["reportdoc"] == null)
{
string report_path = "";
report_path = Server.MapPath("~/Report/TourNote.rpt");
DataSet ds = BusinessObject.TourOrders.GetTourNoteDsRpt(TourOrderId);
if (ViewState["reportdata"] == null)
{
ViewState["reportdata"] = ds;
}
else
{
ds = (DataSet)ViewState["reportdata"];
}
rptDocument = new ReportDocument();
rptDocument.Load(report_path);
rptDocument.SetDataSource(ds);
rptDocument.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
ViewState["reportdoc"] = rptDocument;
}
else
{
rptDocument = (ReportDocument)ViewState["reportdoc"];
}
this.CrystalReportViewer1.ReportSource = rptDocument;
this.CrystalReportViewer1.HasToggleGroupTreeButton = false;
this.CrystalReportViewer1.DisplayGroupTree = false;
}
使用方法.先建了一个数据集做为数据源,作为水晶报表的数据架构.
代码里面调用一个存储过程,返回拥有多张表的DataSet.
希望本文所述对大家的asp.net程序设计有所帮助。
- HighCharts图表控件在ASP.NET WebForm中的使用总结(全)
- ASP.NET WebForm中<%=%>与<%#%>的区别
- WebForm获取checkbox选中的值(几个简单的示例)
- js脚本获取webform服务器控件的方法
- Ajax Throws Sys.WebForms.PageRequestManagerErrorException with Response.Redirect的解决方法
- 如何在WebForm中使用javascript防止连打(双击)
- asp.net WebForm页面间传值方法
- asp.net WebForm页面间传值方法
- Webform 内置对象 Session对象、Application全局对象,ViewState详细介绍
相关文章
C#数据导入/导出Excel文件及winForm导出Execl总结
在asp.net中导出Execl有两种方法.一种是将导出的文件存放在服务器某个文件夹下面.一种是将文件直接将文件输出流写给浏览器2013-01-01
如何在.NET Core中为gRPC服务设计消息文件(Proto)
这篇文章主要介绍了如何在.NET Core中为gRPC服务设计消息文件(Proto),帮助大家更好的理解和学习使用.net技术,感兴趣的朋友可以了解下2021-05-05
.Net Core授权认证方案JWT(JSON Web Token)初探
这篇文章介绍了.Net Core授权认证方案JWT,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2022-06-06


最新评论