国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 内江市| 莱芜市| 密云县| 大理市| 大荔县| 大渡口区| 荥经县| 麻城市| 阜新| 武汉市| 平定县| 长顺县| 高雄县| 西乌| 武城县| 海盐县| 唐海县| 安阳市| 海伦市| 饶阳县| 台中县| 汾阳市| 横峰县| 洛隆县| 安新县| 德清县| 枣强县| 京山县| 东莞市| 始兴县| 嘉峪关市| 呼伦贝尔市| 百色市| 永康市| 沁源县| 封丘县| 平潭县| 石家庄市| 海城市| 星子县| 新巴尔虎右旗|