报告查看器不起作用 [英] Report Viewer Not Working

查看:93
本文介绍了报告查看器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加报告查看器时,它显示以下错误......我认为错误可能在配置文件中请帮助





When iam adding report viewer it shows the following error ......i think the error may be in config file please help


ERROR
 Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'Microsoft.Reporting.WebForms.ReportDataSource' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'

Source Error:


Line 398:        
Line 399:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 400:        private global::Microsoft.Reporting.WebForms.ReportDataSource @__BuildControl__control7() {
Line 401:            global::Microsoft.Reporting.WebForms.ReportDataSource @__ctrl;
Line 402:            


Source File: c:\Users\user\AppData\Local\Temp\Temporary ASP.NET Files\root\590afed4\6e6a8864\App_Web_employeewisereport.aspx.cdcab7d2.4zmytqof.0.cs    Line: 400 









Web.Config






Web.Config

<compilation debug="true">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="Microsoft.Build.Framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </buildProviders>
    </compilation>







ASPX页面




ASPX Page

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"

    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>


<div class='form-vertical'>
                        <rsweb:ReportViewer ID="ReportViewer1"  runat="server" Font-Names="Verdana" 

                            Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
                            <LocalReport ReportEmbeddedResource="SyosysWap.Reports.rptEmployeeWise.rdlc">
                                <DataSources>
                                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 

                                        Name="DataSetrptEmployee" />
                                </DataSources>
                            </LocalReport>
                        </rsweb:ReportViewer>
                        
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 

                            SelectMethod="GetData" 

                            TypeName="ds_EmployeeWiseTableAdapters.sp_Report_Web_EmployeesTableAdapter">
                        </asp:ObjectDataSource>
                        
                    </div>

推荐答案

此问题有多种原因,您必须对其进行故障排除。



1.可能是因为你在一个不应该的目录中有一个额外的web.config。

2.它可能是因为你没有在IIS中指定一个目录作为虚拟目录。

3.可能是因为你的bin文件夹中有一个额外的dll,也许是来自不同项目的dll这也引用了ReportViewer。

4.有时你可以清除Temp ASP.Net文件夹,它会解决。



错误是说你的代码中引用的dll的两个版本之间存在冲突。
There are various reasons for this issue and it is one you'll have to troubleshoot.

1. It can be because you have an extra web.config in a directory where it shouldn't be.
2. It can be because you have not specified a directory as a virtual directory in IIS that should be one.
3. It can be because you have an extra dll in your bin folder, perhaps one from a different project that also references ReportViewer.
4. Sometimes you can clear out the Temp ASP.Net folders and it will resolve.

The error is saying you have a conflict between 2 versions of the dll being referenced in your code.


我解决了将以下版本从10更改为11及其对应的PublicKeyToken



I Solved by replaced the following version from 10 to 11 and its corresponding PublicKeyToken

<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />





替换为





REPLACED WITH

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


这篇关于报告查看器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆