我越来越"对于报告“xxxx.rdlc”报表定义没有指定"在我RDLC报告 [英] I'm getting "The report definition for report 'xxxx.rdlc' has not been specified" in my RDLC report
问题描述
我创建了一个RDLC报告。我有我的窗体上的ReportViewer。
当我尝试加载报告中我得到:报表xxxx.rdlc报表定义尚未指定。我不明白这一点。
我有我需要的报表数据的DataTable。
我借此DataTable,并将我加载它回到我的数据库,一个名为FinalReport表。 (原因我这样做,是因为RDLC需要某种数据源的。)
我有一个表我的报告(表1)内。
这是我的code(我的形式,即报表查看器位于内线):
I've created an rdlc report. I have a reportViewer on my form. When I try to load the report I get : "The report definition for report 'xxxx.rdlc' has not been specified". I can't figure this out. I have a datatable with the data I need for the report. I take this dataTable and I load it back to my database, to a table called "FinalReport". (The reason i'm doing this, is because that rdlc requires some sort of a dataSource.) I have a table inside my report (table1). This is my code (inside my form, where the report viewer is located):
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报告。
我实在看不出这个问题,我搜索谷歌它。
I also connected the report to the dataTable and the reportViewer to the report. I really can't see the problem, and I searched Google for it.
任何帮助将是非常美联社preciated。
Any help will be highly appreciated.
推荐答案
我有同样的问题发生与我的报告之一。这是一个地方,嵌入式报表。
I had this same issue occur with one of my reports. It was a local, embedded report.
- 我没有足够的
ReportEmbeddedResource
属性集。 - 当我设置
ReportEmbeddedResource财产
,它仍然给了错误,因为该报告的名称不正确了的情况下 -myApp.reports.rptMyJobstatus.rdlc
而不是myApp.reports.rptMyJobStatus.rdlc
。
- I didn't have the
ReportEmbeddedResource
property set. - When I did set
ReportEmbeddedResource property
, it still gave the error because the report name had incorrect case -myApp.reports.rptMyJobstatus.rdlc
instead ofmyApp.reports.rptMyJobStatus.rdlc
.
因此,你需要检查这两个条件。
Therefore, you need to check both of these conditions.
这篇关于我越来越"对于报告“xxxx.rdlc”报表定义没有指定"在我RDLC报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!