报告查看器错误消息“客户端找到响应内容类型”但预期’文本xml’请求失败并显示空响应。”
我收到了错误
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("https://server/ReportServer$MSSQL2K5?"); List paramList = new List(); 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 = "" + "True" + ""; byte[] bytes = rview.LocalReport.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);
该行发生错误:
rview.ServerReport.SetParameters(paramList);
地址是正确的,因为我可以通过网络浏览器加载报告:
this.webBrowser1.Navigate("https://server/ReportServer$MSSQL2K5?/Report/Report Invoice&Batch=1&InvoiceNo=0");
我需要使用报告查看器加载报告,以便我可以导出为PDF。
尝试将Uri设置为完整服务uri,例如:
new Uri("https://server/ReportServer$MSSQL2K5/reportservice2005.asmx?")
另外,你需要尾随?
? 我不确定,但如果SetParameters
需要,它是否会被追加?
在我的情况下,此错误是由SSRS服务器耗尽硬盘空间引起的。
在我这边,服务(SSRS)挂在服务器端,不得不强制停止服务并重新启动它。
上述就是C#学习教程:报告查看器错误消息“客户端找到响应内容类型”但预期’文本xml’请求失败并显示空响应。”分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/991045.html