水晶報表asp.net的webform下基本用法實(shí)例
本文實(shí)例講述了水晶報表asp.net的webform下基本用法。分享給大家供大家參考。
具體實(shí)現(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ù)架構(gòu).
代碼里面調(diào)用一個存儲過程,返回?fù)碛卸鄰埍淼腄ataSet.
希望本文所述對大家的asp.net程序設(shè)計(jì)有所幫助。
- HighCharts圖表控件在ASP.NET WebForm中的使用總結(jié)(全)
- ASP.NET WebForm中<%=%>與<%#%>的區(qū)別
- WebForm獲取checkbox選中的值(幾個簡單的示例)
- js腳本獲取webform服務(wù)器控件的方法
- Ajax Throws Sys.WebForms.PageRequestManagerErrorException with Response.Redirect的解決方法
- 如何在WebForm中使用javascript防止連打(雙擊)
- asp.net WebForm頁面間傳值方法
- asp.net WebForm頁面間傳值方法
- Webform 內(nèi)置對象 Session對象、Application全局對象,ViewState詳細(xì)介紹
相關(guān)文章
ASP.NET(C#)驗(yàn)證數(shù)字的兩種方法
ASP.NET(C#)驗(yàn)證數(shù)字的兩種方法,需要的朋友可以參考一下2013-06-06ASP.NET在MVC中MaxLength特性設(shè)置無效的解決方法
這篇文章主要介紹了ASP.NET在MVC中MaxLength特性設(shè)置無效的解決方法,涉及對MVC中表單元素屬性的應(yīng)用技巧,需要的朋友可以參考下2014-11-11集合類List與Dictonary實(shí)例練習(xí)
本文將詳細(xì)介紹下List<>泛型集合/Dictonary<>字典/泛型集合練習(xí) /中日期轉(zhuǎn)換提取為方法以及泛型集合練習(xí)之翻譯軟件,感興趣的你可不要錯過了哈2013-02-02asp.net網(wǎng)站的404錯誤頁面的正確設(shè)置方法
asp.net網(wǎng)站的404錯誤頁面的正確設(shè)置方法,需要的朋友可以參考下。2010-05-05asp.net 通過httpModule計(jì)算頁面的執(zhí)行時間
有時候我們想檢測一下網(wǎng)頁的執(zhí)行效率。記錄下開始請求時的時間和頁面執(zhí)行完畢后的時間點(diǎn),這段時間差就是頁面的執(zhí)行時間了。要實(shí)現(xiàn)這個功能,通過HttpModule來實(shí)現(xiàn)是最方便而且準(zhǔn)確的。2011-02-02ASP.NET MVC Webuploader實(shí)現(xiàn)上傳功能
這篇文章主要為大家詳細(xì)介紹了ASP.NET MVC Webuploader實(shí)現(xiàn)上傳功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-09-09