當前位置:編程學習大全網 - 網站源碼 - asp.net中水晶報表 動態綁定問題

asp.net中水晶報表 動態綁定問題

妳要引入using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Share;

命名空間

然後

ReportDocument poRpt = new ReportDocument();

poRpt.Load(fileName);

SqlDataAdapter sda = new SqlDataAdapter();

sda.SelectCommand = new SqlCommand(sql, con);

sda.SelectCommand.ExecuteNonQuery();

DataSet ds = new DataSet();

sda.Fill(ds, "RepairRecord");

poRpt.SetDataSource(ds);

this.cryRV.ReportSource = poRpt;

就可以了,fileName是妳報表的相對路徑,相對於exe文件,最好把報表跟.exe文件放在壹起,方便

  • 上一篇:XMind 7甘特圖如何變成
  • 下一篇:ncl官網哪裏可以看到代碼?
  • copyright 2024編程學習大全網