本地报告处理期间发生错误。 ---> Microsoft.Reporting.DefinitionInvalidException:报告'xxx'的定义无效

时间:2018-03-26 04:30:55

标签: vb.net reportviewer rdl

我有一个VB应用程序,它将使用.rdl通过 Microsoft.ReportViewer.WinForms 生成PDF格式的报告。

有一些功能允许应用程序在不显示任何UI的情况下运行,以根据数据库中的设置生成某些报告。我们使用任务计划程序每天早上运行应用程序以生成一些日常报告。

我们很少有客户使用相同的应用程序和相同的rdl报告。但是,当任务调度程序触发应用程序而其他客户端工作正常时,客户端中的一个会继续遇到问题。

应用程序基本上每天早上会生成11个报告,但只要任务计划程序在早上触发它,报告中的一个就会继续抛出异常。

  

Microsoft.Reporting.WinForms.LocalProcessingException:   本地报告处理期间发生错误。 Microsoft.Reporting.DefinitionInvalidException:报告'xxx.rdl'的定义无效。

但是当我们触发任务调度程序或之后手动运行程序时,我们无法复制问题。

完整错误堆栈:

Error Message : Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'D:\EASI\AutoReport\SSRSReport\Report\1tic_movie_tax_report.rdl' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Runtime.InteropServices.COMException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile, SecurityZone& zone, StringHandleOnStack retUrl)
   at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence()
   at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)
   at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)
   at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
   at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed)
   at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
   at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
   at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
   at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
   at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
   at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
   at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
   at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
   at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.Xml.Schema.Parser..ctor(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
   at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
   at Microsoft.ReportingServices.RdlObjectModel2005.Upgrade.UpgradeSerializerSettings2005.CreateReaderSettings()
   at Microsoft.ReportingServices.RdlObjectModel2005.Upgrade.UpgradeImpl2005.CreateReaderSettings()
   at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.UpgradeFrom200501(XmlReader xmlReader, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
   at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.UpgradeUnified(Stream stream, XmlReader xmlReader, String namespaceURI, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
   at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.RdlUpgrader.Upgrade(Stream stream, Boolean throwUpgradeException, Boolean upgradeDundasCRIToNative, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
   at Microsoft.ReportingServices.ReportProcessing.RDLUpgrader.UpgradeToCurrent(Stream stream, Boolean throwUpgradeException, Boolean renameInvalidDataSources, RDLUpgradeResult& upgradeResults)
   at Microsoft.ReportingServices.ReportPublishing.RdlObjectModelUpgradeStrategy.Upgrade(Stream definitionStream)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase1(Stream definitionStream, String& description, String& language, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, Boolean& hasExternalImages, Boolean& hasHyperlinks)
   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.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)
   --- End of inner exception stack trace ---
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection)
   at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
   --- End of inner exception stack trace ---
   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.WinForms.LocalReport.EnsureExecutionSession()
   --- End of inner exception stack trace ---
   at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
   at Microsoft.Reporting.WinForms.LocalReport.GetParameters()
   at SSRSReport.frmSsrsReport.SetReportParameter(String ReportTitle)
   at SSRSReport.frmSsrsReport.ViewReport(Boolean showSplash)
   at SSRSReport.frmMain.GenerateAutoReports(DateTime selectedDate)

代码:

1. rptViewer.LocalReport.ReportPath = fileName : executed on function [SSRSReport.frmSsrsReport.ViewReport]
2. rptViewer.LocalReport.GetParameters() : executed on function [SSRSReport.frmSsrsReport.SetReportParameter]

2 个答案:

答案 0 :(得分:0)

主要消息错误与我的问题相同,但细节稍有不同。

就我而言,我需要安装MICROSOFT® REPORT VIEWER 2015 RUNTIME,然后问题就消失了。

HTH

答案 1 :(得分:0)

今天同样的错误:

Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report  'fileName.rdlc' is invalid. ---> 

案例是我使用旧的 VS2015 进行开发,现在尝试将 VS2019 与 RDLC 工具一起使用.. 设计者正在升级 rdlc 文件。

我必须恢复我的 rdlc 文件并返回到旧的 VS2015,然后重新发布它..