我已經創建了rdlc報告。我的表單上有一個reportViewer。 當我嘗試加載我得到的報告時:「報告'xxxx.rdlc'的報告定義尚未指定」。我無法弄清楚這一點。 我有我需要的報告數據的數據表。 我拿這個數據表,我把它加載回我的數據庫,到一個名爲「FinalReport」的表。 (我這樣做的原因是因爲rdlc需要某種數據源。) 我的報告(table1)中有一張表。 這是我的代碼(我的表格,上報觀看者位於內):我在RDLC報告中收到「報告定義報告xxxx.rdlc未指定」
this.finalDataReportTableAdapter.Fill(this.nehasitDataSet.FinalDataReport);
localReport.ReportEmbeddedResource = @"Resources\VisibleAssets.rdlc";
//I'm not so sure about the following line, but it's the only line that prevented me from getting an error ("no reportdefinition defined"
using (StreamReader rdlcSR = new StreamReader(@"Resources\VisibleAssets.rdlc"))
{
localReport.LoadReportDefinition(rdlcSR);
localReport.Refresh();
}
this.reportViewer.RefreshReport();
我也連接到DataTable的報告和的ReportViewer報告。 我真的不能看到問題,我搜索了Google。
任何幫助將不勝感激。
您是否嘗試過將`reportViewer.LocalReport.ReportPath`屬性設置爲報表路徑? – jadarnel27 2011-12-14 15:12:41