2011-09-21 53 views
7

tôi đang sử dụng kiểm soát ReportViewer trong trang aspx của mình. tôi đang truy cập báo cáo từ chế độ xử lý từ xa.Không thể tải tệp hoặc lắp ráp Microsoft.ReportViewer.WebForms.XmlSerializers

đây là mã của tôi:

 ReportServerDomain = System.Configuration.ConfigurationSettings.AppSettings["ReportServerDomain"]; 

     ReportServerUserName = System.Configuration.ConfigurationSettings.AppSettings["ReportServerUserName"]; 

     ReportServerPassword = System.Configuration.ConfigurationSettings.AppSettings["ReportServerPassword"]; 

     String ReportFolder = System.Configuration.ConfigurationSettings.AppSettings["ReportFolderName"]; 

     rptUrl = new Uri(Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["ReportURL"])); 

     IReportServerCredentials irsc = new CustomReportCredentialsToCreateStatement(ReportServerUserName, ReportServerPassword, ReportServerDomain); 

     ReportViewer1.ServerReport.ReportServerCredentials = irsc;  

     ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; 

     parameters = new ReportParameter[1]; 

     parameters[0] = new ReportParameter("ClientStatementBatchId", ds.Tables["ClientStatemtntBatch"].Rows[0]["ClientStatementBatchID"].ToString()); 

     ReportViewer1.ServerReport.ReportServerUrl = rptUrl; 

     ReportViewer1.ServerReport.ReportPath = "/" + ReportFolder + "/Client Statements"; 


     ReportViewer1.ServerReport.SetParameters(parameters); // i am getting error on this line. 

     ReportViewer1.ServerReport.Refresh(); 

Lỗi này là:

Không thể tải tập tin hoặc lắp ráp 'Microsoft.ReportViewer.WebForms.XmlSerializers, Version = 9.0.0.0, Văn hóa = trung lập, PublicKeyToken = b03f5f7f11d50a3a 'hoặc một trong số các phụ thuộc của nó. Hệ thống không thể tìm thấy các tập tin được chỉ định.

Bất kỳ ai có thể giúp tôi, cách giải quyết vấn đề này không?

Cảm ơn,

D.Bernardin

+0

hãy kiểm tra câu hỏi này và tất cả các câu trả lời ở đây trong SO: http://stackoverflow.com/questions/ 4396146/why-cant-i-see-microsoft-reportviewer-webforms-version-10-0-0-0-in-add-referenc –

Trả lời

12

Các bạn đã thử cài đặt lại các file phân phối ReportViewer? Bạn có thể tìm các liên kết ở đây

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6576

http://www.microsoft.com/download/en/details.aspx?id=4016

Người đầu tiên là một trong những liên quan đến VS2008 xem báo cáo, (một trong những khác là dành cho phiên bản 2005) và là một trong đó sẽ giải quyết vấn đề của bạn .

+0

sẽ làm việc này cho các dịch vụ báo cáo năm 2008 r2? – MJCoder

+0

hoạt động cho tôi ... cảm ơn! –

0

Nguyên nhân gốc cho vấn đề này là vấn đề phiên bản Microsft.ReportViewer.Webforms dll. Giải pháp là tải xuống và chạy exe ReportViewer.exe từ vị trí http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6576. Vấn đề thực tế của chúng tôi là dll báo cáo liên quan của chúng tôi là trỏ đến một số phiên bản cũ tức là không đến phiên bản 11.0.0.0. Khi exe này đã chạy đúng cách nó sẽ được trỏ đến phiên bản 11.0.0.0. Để làm việc nó đúng cách làm cho cùng một mục trong cả web cấu hình

<add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, 
Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>" 

và khu vực đăng ký cũng

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, 
Culture=neutral, PublicKeyToken=89845dcd8080cc91" 
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>" 
Các vấn đề liên quan