国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > .NET > 正文

水晶報(bào)表asp.net的webform下基本用法實(shí)例

2024-07-10 12:48:18
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了水晶報(bào)表asp.net的webform下基本用法。。

具體實(shí)現(xiàn)方法如下:

代碼如下: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;
}

使用方法.先建了一個(gè)數(shù)據(jù)集做為數(shù)據(jù)源,作為水晶報(bào)表的數(shù)據(jù)架構(gòu).

代碼里面調(diào)用一個(gè)存儲(chǔ)過(guò)程,返回?fù)碛卸鄰埍淼腄ataSet.

希望本文所述對(duì)大家的asp.net程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 嘉善县| 玉环县| 明水县| 安岳县| 南城县| 亳州市| 桂平市| 龙游县| 东乡族自治县| 叶城县| 漯河市| 井研县| 富蕴县| 宜丰县| 凤台县| 乌兰察布市| 雷波县| 晴隆县| 泰州市| 伊宁县| 化州市| 朝阳县| 齐齐哈尔市| 丽江市| 溧阳市| 璧山县| 元江| 石台县| 常熟市| 鄂托克旗| 句容市| 仁布县| 秦安县| 砚山县| 荥经县| 宁城县| 象山县| 嫩江县| 肇源县| 柳河县| 潜江市|