這篇文章主要講解了“水晶報表asp.net中webform的使用方法”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“水晶報表asp.net中webform的使用方法”吧!
本文實例講述了水晶報表asp.net的webform下基本用法。分享給大家供大家參考。
具體實現(xiàn)方法如下:
復(fù)制代碼 代碼如下:
protected void Page_Init(object sender, EventArgs e)
{
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è)計有所幫助。
感謝各位的閱讀,以上就是“水晶報表asp.net中webform的使用方法”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對水晶報表asp.net中webform的使用方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
分享題目:水晶報表asp.net中webform的使用方法-創(chuàng)新互聯(lián)
文章地址:http://www.rwnh.cn/article4/jhhoe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護、小程序開發(fā)、企業(yè)建站、移動網(wǎng)站建設(shè)、網(wǎng)站制作、企業(yè)網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容