关于 winforms:DefinitionInvalidException 来自 Microsoft Report Viewer 2008

DefinitionInvalidException from Microsoft Report Viewer 2008

我的应用程序(winforms .net 2.0 / vs2008)在我的开发机器上运行良好,但在其中一台测试机器上我得到了这个异常。
有没有人遇到过类似的情况?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
************** Exception Text **************
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information.
   at Microsoft.ReportingServices.Diagnostics.DataProtectionLocal.ProtectData(Byte[] data, Int32 dwFlags)
   at Microsoft.ReportingServices.DataExtensions.DataSourceInfo..ctor(String originalName, String extension, String connectionString, Boolean originalConnectStringExpressionBased, Boolean integratedSecurity, String prompt)
   at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.ReadDataSource(DataSourceNameValidator dataSourceNames, PublishingContext context)
   at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.ReadDataSources(PublishingContext context)
   at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.ReadReport()
   at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.Phase1(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, String& description, String& language, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, Boolean& hasExternalImages, Boolean& hasHyperlinks)
   at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileReport(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
   at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
   --- End of inner exception stack trace ---
   at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
   at Microsoft.Reporting.StandalonePreviewStore.StoredReport.CompileReport()
   at Microsoft.Reporting.StandalonePreviewStore.StoredReport.get_Snapshot()
   at Microsoft.Reporting.StandalonePreviewStore.GetCompiledReport(CatalogItemContext context, Boolean rebuild, ReportSnapshotBase& snapshot)
   at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContext itemContext, Boolean rebuild, ReportSnapshotBase& snapshot)
   at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContext itemContext, Boolean rebuild)
   at Microsoft.Reporting.WinForms.LocalReport.CompileReport()
   --- End of inner exception stack trace ---
   at Microsoft.Reporting.WinForms.LocalReport.CompileReport()
   at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
   at XXX.Helpers.Report.PrintFavs(List`1 list, String header, String filename) in C:\\Data\\projects\\workdir_cpv\\Src\\Classes\\Helpers\
eport.cs:line 112

我的安装程序会复制所有需要的 dll

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.ProcessingObjectModel.dll

Microsoft.ReportViewer.Winforms.dll

到 ProgramFiles/myAppname 文件夹。

它在 Vista/XP 上完美运行,但问题在于 Win98。
我会尝试在 GAC 上安装这些 dll,也许这是个问题。我试图避免在我的安装程序中运行额外的安装程序。

@keithwarren7:

如果这是真的,那真是太愚蠢了。你知道任何简单的


用于报表和报表查看器的 vs2008 设计器不向后兼容 2.0。同样,您无法使用 vs2008 设计 2005 报告 - 这可能是您的问题。


我曾经有过类似的事情。您可能需要确保测试机器在 GAC 中安装了 ReportViewer dll。 Microsoft 创建了一个安装程序来简化此操作。

问题:您是否在本地模式下使用 Reporting Services,并在 winforms 中使用报表查看器控件?