当前位置: 代码迷 >> 报表 >> RDLC 表格 和 MVC4 的互套
  详细解决方案

RDLC 表格 和 MVC4 的互套

热度:792   发布时间:2016-04-29 01:56:47.0
RDLC 报表 和 MVC4 的互套

前期知识点:

RLDC

MVC4



=========================解决一下错误需要做个前期工作=========================

想查看一下SharePoint的Microsoft.SharePoint.Library.DLL, 可是发现这个文件被安装在了GAC中. 如何才能拿到这个DLL, 反汇编一下玩玩呢?GAC的目录在c:\windows\assembly, 而这个目录是不允许你直接复制粘贴的. 为了把文件拿出来, 你需要使用命令行.

如果你使用命令行的话, 你会发现GAC的目录结构与Windows Explorer展示给你的看的目录不同.

 要把文件从GAC中拿到, 你可以运行下面的命令:

C:\WINDOWS\assembly\GAC_MSIL>xcopy *.* C:\GACDLLs\ /s /r

具体程序集所在的目录也许会不同. 有可能是GAC 或者是GAC_32. 先找到你想要的文件, 然后你可能会需要从上面列出的文件夹中进行拷贝.

具体操作

win+r

cmd

cd C:\WINDOWS\assembly\GAC_MSIL>

xcopy *.* C:\GACDLLs\ /s /r


=========================发布错误=========================

Server Error in '/' Application.
--------------------------------------------------------------------------------


Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 


Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。


Source Error: 




Line 27:   <system.web>
Line 28:     <httpHandlers>
Line 29:       <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
Line 30:     </httpHandlers>
Line 31:     <compilation targetFramework="4.0" />
 


Source File: E:\OA_Npp_Pro测试\web.config    Line: 29 


Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.




WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


 解决方案:
拷贝 C:\GACDLLs\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91 目录下的 Microsoft.ReportViewer.WebForms.dll  文件到网站发布bin目录下

=========================发布错误=========================

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:1. Add a "Debug=true" directive at the top of the file that generated the error. Example:  <%@ Page Language="C#" Debug="true" %>or:2) Add the following section to the configuration file of your application:<configuration>   <system.web>       <compilation debug="true"/>   </system.web></configuration>Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.  Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].Stack Trace: [FileNotFoundException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。]   Microsoft.Reporting.WebForms.LocalReport..ctor() +0   Microsoft.Reporting.WebForms.ReportHierarchy..ctor(ServerReport serverReport) +120   Microsoft.Reporting.WebForms.ReportViewer.CreateReportHierarchy() +51   Microsoft.Reporting.WebForms.ReportViewer..ctor() +281   ASP.webforms_webform1_aspx.__BuildControlReportViewer1() +33   ASP.webforms_webform1_aspx.__BuildControlform1() +999   ASP.webforms_webform1_aspx.__BuildControlTree(webforms_webform1_aspx __ctrl) +189   ASP.webforms_webform1_aspx.FrameworkInitialize() +29   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +54   System.Web.UI.Page.ProcessRequest() +78   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21   System.Web.UI.Page.ProcessRequest(HttpContext context) +49   ASP.webforms_webform1_aspx.ProcessRequest(HttpContext context) +4   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75--------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.504 

解决方案:拷贝 C:\GACDLLs\Microsoft.ReportViewer.Common\11.0.0.0__89845dcd8080cc91 下Microsoft.ReportViewer.Common.dll 到bin目录下即可


=========================发布错误=========================

An error occurred during local report processing.
The report definition for report 'Report1' has not been specified
Could not find file 'E:\OA_Npp_Pro测试\RDLC\Report1.rdlc'. 


解决方案:拷贝Report1.rdlc'. 文件到 服务器 rdlc 目录下


=========================发布错误=========================

An error occurred during local report processing.
The definition of the report 'RDLC\Report1.rdlc' is invalid.
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。 


解决方案:

拷贝 C:\GACDLLs\Microsoft.SqlServer.Types\11.0.0.0__89845dcd8080cc91 目录下 Microsoft.SqlServer.Types.dll  到服务器发布bin目录下


=========================发布错误=========================


An error occurred during local report processing.
The definition of the report 'RDLC\Report1.rdlc' is invalid.
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. 系统找不到指定的文件。 


解决方案:

拷贝 C:\GACDLLs\Microsoft.ReportViewer.ProcessingObjectModel\11.0.0.0__89845dcd8080cc91 目录下 Microsoft.ReportViewer.ProcessingObjectModel.DLL 到发布目录bin 下