报表查看器不会显示报表 [英] Reporting viewer won't show report
问题描述
嗨
我收到了报告查看器,该报告查看器不显示报告,而是显示客户端找到的响应内容类型为"'',但预期为"text/xml" ..."错误,INSIDE报告了查看器主体(查看器的顶部菜单)正常显示).
我运行了报表服务(SQL 2008 R2),我的用户可以查看报表并通过localhost/reports运行它们.我确实注册了IReportServerConnection2实现类.是,处理模式设置为远程.
无法找到解决方案.我也不明白为什么将ReportServerUrl设置两次(我的实现类似于: ^ ]
检查一下:
[可序列化]
公共 类 MyReportServerConnection:IReportServerConnection2
{
公共 Uri ReportServerUrl
{
获取
{
字符串 url = " ;
如果(字符串.IsNullOrEmpty(url))
抛出 新异常(" 缺少Web.config文件中的网址" );
返回 新 Uri(url);
}
}
并在页面上:
受保护的 无效 Page_Load(对象发件人,System.EventArgs e)
{
如果(!Page.IsPostBack)
{
DoBind();
}
如果(!Page.IsPostBack&& Request.QueryString.Count > 字符串 reportPath = Request.QueryString [ 0 ];
此 .ReportLabel.Text = Request.QueryString [ 0 ];
// this.ReportViewer1.ProcessingMode = ProcessingMode.Remote;
MyReportServerConnection rsc = 新 MyReportServerConnection();
此 .ReportViewer1.ServerReport.ReportServerCredentials = rsc;
// 已为测试进行硬编码的路径
此 .ReportViewer1.ServerReport.ReportPath = " ;
此 .ReportViewer1.ServerReport.ReportServerUrl =
新 Uri((" ));
此 .ReportViewer1.ServerReport.Refresh();
}
感谢所有帮助
已将其修复.在报表管理器中,我必须更改连接的属性,因此必须使用安全存储在报表服务器中的凭据,而不是使用Windows集成安全性+在连接到数据源时用作Windows凭据.
>
Hi
I got reporting viewer that won''t display report, instead I get "Client found response content type of '''', but expected ''text/xml''..." error INSIDE reporting viewer body (top menu of viewer displays normally).
I got reporting service running (SQL 2008 R2), my user can see reports and run them through localhost/reports. I did register my IReportServerConnection2 implementation class. And yes processing mode is set to remote.
Cant find solution. I also don''t understand why ReportServerUrl is set twice (my implementation is similar to: http://blogs.msdn.com/b/microsoftbob/archive/2009/08/20/a-wrapper-for-running-sql-server-2008-reporting-services-reports-anonymously.aspx[^]
Check this out:
[Serializable]
public class MyReportServerConnection : IReportServerConnection2
{
public Uri ReportServerUrl
{
get
{
string url = "http://localhost/ReportServer/ReportService2010.asmx";
if (string.IsNullOrEmpty(url))
throw new Exception("Missing url from the Web.config file");
return new Uri(url);
}
}
and on page:
protected void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
DoBind();
}
if (!Page.IsPostBack && Request.QueryString.Count > 0)
{
string reportPath = Request.QueryString[0];
this.ReportLabel.Text = Request.QueryString[0];
//this.ReportViewer1.ProcessingMode = ProcessingMode.Remote;
MyReportServerConnection rsc = new MyReportServerConnection();
this.ReportViewer1.ServerReport.ReportServerCredentials = rsc;
//pathhardcoded for test
this.ReportViewer1.ServerReport.ReportPath = "/report1";
this.ReportViewer1.ServerReport.ReportServerUrl =
new Uri(("http://localhost/ReportServer/"));
this.ReportViewer1.ServerReport.Refresh();
}
Any help appreciated
Got it fixed. In report manager I had to change properties of connection so instead of using Windows integrated security I had to use Credentials stored securely in the report server + Use as Windows credentials when connecting to the data source.
这篇关于报表查看器不会显示报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!