10

最近、ローカル レポートを含む WinForms アプリを .NET 3.5 から .NET 4.0 に更新しました。Microsoft.ReportViewer.WinFormsMicrosoft.ReportViewer.Common、およびのバージョン 11.0 アセンブリをMicrosoft.ReportViewer.ProcessingObjectModelアプリケーション ディレクトリに含めます。.NET 3.5 を使用してこのアプリをデプロイするのに必要なのはこれだけですが、.NET 4.0 を使用し、VisualStudio または SQL Server を使用しないターゲット マシンで次のエラーが発生します。

TYPE: Microsoft.Reporting.WinForms.LocalProcessingException
MSG: An error occurred during local report processing.
SOURCE: Microsoft.ReportViewer.WinForms
SITE: EnsureExecutionSession
   at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
   at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._SetReportParameters(String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer._RefreshReport(DataTable sourceTable, String sourceName, String reportResourceName, String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.ReportContainer.ShowMissingReport(MissingFilesDataTable missingTable, String departmentName, String footer)
   at Ceoimage.Basecamp.MaintainDocumentIntegrity.DocumentIntegrityForm._HandleMissingComplete(Object sender, RunWorkerCompletedEventArgs e)

-- INNER EXCEPTION --
TYPE: Microsoft.Reporting.DefinitionInvalidException
MSG: The definition of the report '' is invalid.
SOURCE: Microsoft.ReportViewer.Common
SITE: CompileReport
   at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
   at Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
   at Microsoft.Reporting.LocalService.CompileReport()
   at Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
   at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()

-- INNER EXCEPTION --
TYPE: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException
MSG: An unexpected error occurred in Report Processing.
SOURCE: Microsoft.ReportViewer.Common
SITE: CreateIntermediateFormat
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
   at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)

-- INNER EXCEPTION --
TYPE: System.IO.FileNotFoundException
MSG: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
SOURCE: Microsoft.ReportViewer.Common
SITE: Write
FILE: Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType)
   at Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Serialize(IntermediateFormatWriter writer)
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(IPersistable persistableObj, Boolean verify)
   at Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets()
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(Byte[] definition, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)

Report Viewer 2012 Redistributableを実行してみましたが、それもMicrosoft.SqlServer.Types. これがローカル レポートであるにもかかわらず、なぜこの新しい依存関係があるのか​​ わかりません。Microsoft.ReportViewer.*このコードでは、これら 3 つのアセンブリのみを必要とする .NET 3.5 バージョンで使用される高度なデータ型やそれを超えるものは使用しません。Report Viewer を使用して .NET 4.0 アプリを展開するための要件の有限リストを誰か教えてもらえますか?

4

3 に答える 3

5

Report Viewer 2012 Redistributable に提供したリンクの一番下にいくつかの情報があります。

追加情報

サーバー処理モードの前提条件 Microsoft SQL Server 2008 Reporting Services 以降。NET Framework 3.5 SP1 または .NET Framework 4.0 SQL Server システム CLR 型パッケージ

SQL Server システム CLR 型パッケージが不足しているようです。SQL Server Feature Pack からダウンロードできます。ここに、Feature Pack のインストーラーの最新リストへのリンクがあります。

http://www.microsoft.com/en-us/download/details.aspx?id=26728 x86 などに応じて、複数のリストが表示されます。

うまくいけば、これは役に立ちます。

于 2013-02-06T06:33:07.827 に答える
0

このエラーの主な理由は、プロジェクトまたはセットアップ ファイルがレポート ビューアー dll にアクセスできないためです。そのため、レポート ビューアーに関連する次のすべての dll ファイルを手動で追加します。

  1. Microsoft.ReportViewer.Common
  2. Microsoft.ReportViewer.ProcessingObjectModel
  3. Microsoft.ReportViewer.WinForms
  4. Microsoft.ReportViewer.DataVisualization

今、私はこのエラーが簡単に解決することを願っています.

于 2014-03-14T07:52:19.233 に答える