C# 报表查看器错误消息";客户端发现响应内容类型为'';但预期';文本xml';请求失败,响应为空。”;
我发现了错误C# 报表查看器错误消息";客户端发现响应内容类型为'';但预期';文本xml';请求失败,响应为空。”;,c#,reporting-services,C#,Reporting Services,我发现了错误 client found response content type of '' but expected 'text xml' The request failed with an empty response. 当我尝试执行以下代码时 //create a PDF from the SQL report ReportViewer rview = new ReportViewer(); rview.ServerReport.ReportServerUrl = new Uri(
client found response content type of '' but expected 'text xml' The request failed with an empty response.
当我尝试执行以下代码时
//create a PDF from the SQL report
ReportViewer rview = new ReportViewer();
rview.ServerReport.ReportServerUrl = new Uri("http://server/ReportServer$MSSQL2K5?");
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new Microsoft.Reporting.WinForms.ReportParameter("Batch", "1"));
paramList.Add(new Microsoft.Reporting.WinForms.ReportParameter("InvoiceNo", "0"));
rview.ServerReport.ReportPath = "Report/Report Invoice";
rview.ServerReport.SetParameters(paramList);
string mimeType, encoding, extension, deviceInfo;
string[] streamids;
Microsoft.Reporting.WinForms.Warning[] warnings;
string format = "PDF"; //Desired format goes here (PDF, Excel, or Image)
deviceInfo =
"<DeviceInfo>" +
"<SimplePageHeaders>True</SimplePageHeaders>" +
"</DeviceInfo>";
byte[] bytes = rview.LocalReport.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);
地址正确,因为我可以通过web浏览器加载报告:
this.webBrowser1.Navigate("http://server/ReportServer$MSSQL2K5?/Report/Report Invoice&Batch=1&InvoiceNo=0");
我需要用报表查看器加载报表,以便可以导出为PDF格式 尝试将Uri设置为完整服务Uri,例如:
new Uri("http://server/ReportServer$MSSQL2K5/reportservice2005.asmx?")
此外,是否需要尾随的
?
?我不确定,但是如果SetParameters
需要的话,它不会被追加吗?在我的情况下,这个错误是由SSRS服务器的硬盘空间不足引起的。在我这边,服务(SSRS)挂在服务器端,必须强制停止服务并重新启动它。我尝试了你的建议,但效果不太好,但是rview.ServerReport.ReportServerUrl=new-Uri(“);非常好!谢谢你的帮助!
new Uri("http://server/ReportServer$MSSQL2K5/reportservice2005.asmx?")