2010-10-05 20 views
8

Tôi gặp lỗiBáo cáo trình xem Thông báo lỗi "khách hàng tìm thấy loại nội dung phản hồi của '' nhưng dự kiến ​​'văn bản xml' Yêu cầu không thành công với một phản hồi trống."

client found response content type of '' but expected 'text xml' The request failed with an empty response. 

khi tôi cố gắng thực thi mã sau đây.

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

Lỗi này xảy ra trên dòng:

rview.ServerReport.SetParameters(paramList); 

Địa chỉ là đúng như tôi có thể nạp tiền phạt báo cáo thông qua một trình duyệt web:

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

tôi cần phải tải báo cáo với trình xem báo cáo để tôi có thể xuất dưới dạng PDF.

Trả lời

5

Hãy thử thiết lập các Uri uri đến dịch vụ đầy đủ, ví dụ:

new Uri("http://server/ReportServer$MSSQL2K5/reportservice2005.asmx?") 

Bên cạnh đó, bạn cần các dấu ?? Tôi không chắc chắn, nhưng nó sẽ không được nối thêm nếu cần thiết bởi SetParameters?

+0

Tôi cố gắng gợi ý của bạn mà không hoàn toàn công việc nhưng rview.ServerReport.ReportServerUrl = new Uri ("http: //devserver/ReportServer$MSSQL2K5/ReportExecution2005.asmx"); hoạt động hoàn hảo! Cảm ơn bạn đã giúp đỡ! – WillMcKill

8

Trong trường hợp của tôi, lỗi này do máy chủ SSRS hết dung lượng ổ đĩa cứng gây ra.

1

Về phía tôi, dịch vụ (SSRS) bị treo ở phía máy chủ, buộc phải ngừng dịch vụ và khởi động lại dịch vụ.

Các vấn đề liên quan