gpt4 book ai didi

c# - 报告查看器错误消息 "client found response content type of ' ' 但预期为 'text xml' 请求失败,响应为空。”

转载 作者:太空狗 更新时间:2023-10-29 18:17:05 25 4
gpt4 key购买 nike

我遇到了错误

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);

错误发生在线路上:

rview.ServerReport.SetParameters(paramList);

地址是正确的,因为我可以通过网络浏览器正常加载报告:

this.webBrowser1.Navigate("http://server/ReportServer$MSSQL2K5?/Report/Report Invoice&Batch=1&InvoiceNo=0");

我需要使用报告查看器加载报告,以便可以导出为 PDF。

最佳答案

在我的例子中,这个错误是由 SSRS 服务器硬盘空间不足引起的。

关于c# - 报告查看器错误消息 "client found response content type of ' ' 但预期为 'text xml' 请求失败,响应为空。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3865825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com