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

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

asp.net 水晶報(bào)表-主從表關(guān)聯(lián)問(wèn)題

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

一、使用視圖meeting將多表關(guān)聯(lián)整合在一起

二、通過(guò)Sql語(yǔ)句篩選數(shù)據(jù)

三、建立和主從表的關(guān)聯(lián)

四、注意在CrystalReport1表中插入子報(bào)表的時(shí)候,一定要將主從表的關(guān)聯(lián)字段設(shè)置好,否則出亂子

主體代碼如下:

/// <summary>
  /// Bind CrystalReport
  /// </summary>
  /// <param name="strS">sql</param>
  PRivate void bdReport(string strS)
  {
   oCR = new CrystalReport1();
   SqlConnection cnn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionSqlServer"]);

   SqlDataAdapter cmd1 = new SqlDataAdapter(strS,cnn);

   //Create and fill the DataSet.

   DataSet2 ds = new DataSet2();
   cmd1.Fill(ds,"meeting");

   // SqlDataAdapter cmd2 = new SqlDataAdapter("select * from realplan where rplanid in (select top 10000 planid from ("+sqlStr+")as  a order by planid)", cnn);
   SqlDataAdapter cmd2 = new SqlDataAdapter(SqlIsOper, cnn);
  
   cmd2.Fill(ds,"realplan");

   //Create the relation between the Authors and Titles tables.
   ds.Relations.Add("mo",
    ds.Tables["meeting"].Columns["planid"],
    ds.Tables["realplan"].Columns["rplanid"]);

   //binding reportViewer
   oCR.SetDataSource(ds);

   this.CrystalReportViewer1.ReportSource = oCR;

   //Close the connection.
   cnn.Close();
  
  }

http://skylaugh.VEVb.com/archive/2006/05/22/406520.html


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 建德市| 甘谷县| 松潘县| 灵山县| 侯马市| 政和县| 大足县| 随州市| 汪清县| 钟祥市| 泰和县| 泊头市| 贺兰县| 丁青县| 博罗县| 衡阳市| 富锦市| 华亭县| 庄浪县| 鱼台县| 鲁山县| 通辽市| 巴南区| 遂宁市| 柏乡县| 昌邑市| 庆城县| 塘沽区| 新晃| 哈密市| 鄂温| 嘉峪关市| 佛教| 克拉玛依市| 乾安县| 商洛市| 赞皇县| 台中市| 称多县| 望谟县| 申扎县|