我遇到报告服务问题,在 2005 版本上运行本地 rdlc 文件。
我在 HTML 中有一个报告查看器设置为在本地运行,如下所示:
<rsweb:ReportViewer ID="ReportingServicesReportViewer" runat="server" Height="100%"
ProcessingMode="Local" ShowParameterPrompts="False" Width="100%">
</rsweb:ReportViewer>
在代码中
// create SqlConnection
SqlConnection myConnection = new SqlConnection(ConnectionString);
myCommand.Connection = myConnection;
SqlDataAdapter da = new SqlDataAdapter(myCommand);
//get the data
DataSet data = new DataSet();
da.Fill(data);
if (data != null && data.Tables.Count > 0 && data.Tables[0].Rows.Count > 0)
{
ReportingServicesReportViewer.Visible = true;
ltrStatus.Text = string.Empty;
//provide local report information to viewer
ReportingServicesReportViewer.LocalReport.ReportPath = Server.MapPath(Report.RDLCPath);
//bind the report attributes and data to the reportviewer
ReportDataSource rds = new ReportDataSource("DataSet1", data.Tables[0]);
ReportingServicesReportViewer.LocalReport.DataSources.Clear();
ReportingServicesReportViewer.LocalReport.DataSources.Add(rds);
ReportingServicesReportViewer.LocalReport.Refresh();
}
else
{
ReportingServicesReportViewer.Visible = false;
ltrStatus.Text = "No data to display.";
}
当使用报表结果填充报表查看器的方法被执行时,没有任何东西出现,就好像报表查看器根本不存在一样。
到目前为止我为解决问题所做的工作:
- 检查事件查看器是否有错误,这是唯一相关的事情 我得到的 [Domain]\sp_dbadmin 原因: 无法打开明确指定的数据库。 .然而, 我正在连接的用户是系统管理员。我已经检查过了 我确定是因为我检查了 sys.server_role_members
- 我尝试冒充已登录用户,但无济于事
- 我创建了一个具有系统管理员权限的特定用户,并授予了 IIS 和 sql server 2008 的所有访问权限。
有没有人遇到过类似的问题,有什么想法吗?
最佳答案
我在 VS2012 上遇到了同样的问题,报告显示正在加载图像,然后在加载完成后,报告是空白的。数据存在但未呈现。
解决方案:只需将 Report AsyncRendering 更改为 False 即可使报告再次正常工作。
关于c# - 报表查看器未加载,显示空白区域 - 正在运行本地 RDLC 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7754544/