水晶報表asp.net的webform下基本用法實例
本文實例講述了水晶報表asp.net的webform下基本用法。分享給大家供大家參考。
具體實現(xiàn)方法如下:
{
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;
}
使用方法.先建了一個數(shù)據(jù)集做為數(shù)據(jù)源,作為水晶報表的數(shù)據(jù)架構.
代碼里面調用一個存儲過程,返回擁有多張表的DataSet.
希望本文所述對大家的asp.net程序設計有所幫助。
- HighCharts圖表控件在ASP.NET WebForm中的使用總結(全)
- ASP.NET WebForm中<%=%>與<%#%>的區(qū)別
- WebForm獲取checkbox選中的值(幾個簡單的示例)
- js腳本獲取webform服務器控件的方法
- Ajax Throws Sys.WebForms.PageRequestManagerErrorException with Response.Redirect的解決方法
- 如何在WebForm中使用javascript防止連打(雙擊)
- asp.net WebForm頁面間傳值方法
- asp.net WebForm頁面間傳值方法
- Webform 內置對象 Session對象、Application全局對象,ViewState詳細介紹
相關文章
ASP.NET在MVC中MaxLength特性設置無效的解決方法
這篇文章主要介紹了ASP.NET在MVC中MaxLength特性設置無效的解決方法,涉及對MVC中表單元素屬性的應用技巧,需要的朋友可以參考下2014-11-11asp.net網(wǎng)站的404錯誤頁面的正確設置方法
asp.net網(wǎng)站的404錯誤頁面的正確設置方法,需要的朋友可以參考下。2010-05-05asp.net 通過httpModule計算頁面的執(zhí)行時間
有時候我們想檢測一下網(wǎng)頁的執(zhí)行效率。記錄下開始請求時的時間和頁面執(zhí)行完畢后的時間點,這段時間差就是頁面的執(zhí)行時間了。要實現(xiàn)這個功能,通過HttpModule來實現(xiàn)是最方便而且準確的。2011-02-02ASP.NET MVC Webuploader實現(xiàn)上傳功能
這篇文章主要為大家詳細介紹了ASP.NET MVC Webuploader實現(xiàn)上傳功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-09-09