2013-02-04 64 views
10

我最近更新了一個WinForms應用程序,從.NET 3.5到包含本地報告的.NET 4.0。我在應用程序目錄中包含了用於Microsoft.ReportViewer.WinForms,Microsoft.ReportViewer.CommonMicrosoft.ReportViewer.ProcessingObjectModel的版本11.0程序集,這是使用.NET 3.5部署此應用程序所需的全部內容,但是在具有.NET 4.0的目標計算機上卻沒有VisualStudio或SQL服務器:WinForms ReportViewer在.NET 4.0中是否具有其他部署依賴項?

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。我不明白爲什麼我有這個新的依賴,即使這是一個本地報告。該代碼不使用任何高級數據類型或超出它在.NET 3.5版本中使用的任何高級數據類型,只需要這三個​​程序集。有人可以給我一個使用報告查看器部署.NET 4.0應用程序的有限清單嗎?

回答

5

您爲Report Viewer 2012 Redistributable提供的鏈接在最下方有一些信息。

信息

先決條件的Microsoft SQL Server 2008報表服務或服務器的處理模式更高。 NET Framework 3.5 SP1或.NET Framework 4.0 SQL Server系統CLR類型包

看起來像缺少SQL Server系統CLR類型包。它可以從SQL Server Feature Pack下載 - 這裏是鏈接到功能包安裝程序的最新列表。

http://www.microsoft.com/en-us/download/details.aspx?id=26728你會看到這取決於86等

希望這將有助於多個列表。

+0

但我仍然不明白爲什麼我需要「服務器處理模式」爲本地報告,或者就此而言,什麼「服務器處理模式」甚至是。 – flipdoubt

+0

以下是對軟件包的描述:SQLServer®2008 R2的Microsoft®System CLR類型SQL Server System CLR Types軟件包包含在SQL Server 2008 R2中實現幾何,地理和層次結構id類型的組件。此組件可以與服務器分開安裝,以允許客戶端應用程序在服務器外部使用這些類型。 所以你必須在你的報告中使用這些類型之一,所以這是必需的,無論它是服務器還是本地的 –

+0

由於答案是「是」,我將標記這個答案。儘管如此,我仍未對.NET 3.5中不需要「這些類型」的報告進行更改。 – flipdoubt

0

主要的原因錯誤是項目或安裝文件是不能訪問的報表查看器的DLL,所以添加所有relted以下dll文件到的ReportViewer手動

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

現在我希望這個錯誤很容易解決。

相關問題