2013-09-27 75 views
0

我有一個多行數據表。我想將這個數據表綁定到水晶報表。如何從數據表中添加多行到水晶報表

這怎麼可能?

 Dsprint.Tables.Clear(); 
     Dsprint.Tables.Add(dtTitle); 
     Dsprint.Tables.Add(dtitem); 
     ReportDocument Rpt = new ReportDocument(); 
     string filepath = Application.StartupPath.Replace("bin\\Debug", "") +     @"\CrystalReports\CryDayReport.rpt"; 
     Rpt.Load(filepath); 
     frmCrystalReportViewer newReportViewer = new frmCrystalReportViewer(); 
     Rpt.SetDataSource(Dsprint); 
     Dsprint.WriteXmlSchema(Environment.CurrentDirectory + "\\DayReport.xsd"); 
     newReportViewer.crViewer.ReportSource = Rpt; 
     newReportViewer.ShowDialog(); 

回答

0

你有兩個選擇

1)使用分組

在此,你可以在這個領域的屬性以創建通過ID和禁止如果重複在Crystal報表組。

2)抑制是否重複。

如果數據按ID排序,那麼這個選項也是好的。只需右鍵單擊ID字段並選擇屬性,並檢查抑制是否重複。