使用c#报告查看器的空白报告

时间:2015-01-29 06:21:28

标签: c# reporting reportviewer report-viewer2010

我一直在网上搜索,但没有成功。

我的问题是,当我使用c#查看报告时,报告查看器显示为空白,并且甚至不显示报告徽标或报告的设计。

我在c#

中使用此代码
using Microsoft.Reporting.WinForms;

DBconnection dbConString = new DBconnection(); //initialize connectDB with connection string
FbConnection dbConnect = new FbConnection(dbConString.getConnectionString()); // connect to database using connectdb

dbConnect.Open();

FbDataAdapter dbAdapter = new FbDataAdapter(Commandstring, dbConnect); // this is used in select query
DataTable dbDataTable = new DataTable(); // initiallization of table
dbAdapter.Fill(dbDataTable); // fills the table dtDataTable

ReportDataSource rprtDTSource = new ReportDataSource(dbDataTable.TableName, dbDataTable);

dbDataTable.TableName = "personnel_services";
this.Text = "Individual Personnel Service";

this.reportViewer1.LocalReport.ReportPath = "reports/" + "indi3" + ".rdl";

ReportParameter[] param = new ReportParameter[2];
param[0] = new ReportParameter("sigName", MainFrmManager.stbarEmpName.Text);
param[1] = new ReportParameter("positionName", MainFrmManager.stbarPosition.Text);
this.reportViewer1.LocalReport.SetParameters(param);

this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(rprtDTSource);

this.WindowState = FormWindowState.Maximized;
this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
this.reportViewer1.RefreshReport();

网络建议设置

asyncrendering = false

但我无法找到设置该属性的位置。任何人都可以教我在哪里设置asyncrendering或任何其他解决方案吗?

我正在使用报表生成器3来创建没有报表服务器的报表。

0 个答案:

没有答案