Произошла ошибка при обработке локального отчета. ---› Microsoft.Reporting.DefinitionInvalidException: недопустимое определение отчета «xxx»

У меня есть приложение VB, которое будет использовать .rdl для создания отчетов в формате PDF с помощью Microsoft.ReportViewer.WinForms.

Существуют функции, которые мы позволяем приложению запускать без отображения какого-либо пользовательского интерфейса для создания определенных отчетов на основе настроек в базе данных. И мы используем планировщик задач для ежедневного запуска приложения утром для создания некоторых ежедневных отчетов.

У нас есть несколько клиентов, использующих одно и то же приложение с одинаковыми отчетами rdl. Но один из клиентов продолжает получать проблему, когда планировщик задач запускает приложение, в то время как другие работают нормально.

Приложение в основном генерирует 11 отчетов каждый день по утрам, но 1 из отчетов продолжает выдавать исключение всякий раз, когда планировщик задач запускает его утром.

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]

person Kenvin    schedule 26.03.2018    source источник


Ответы (2)


Ошибка основного сообщения такая же, как и у моей проблемы, но детали немного отличаются.

В моем случае мне нужно установить СРЕДСТВО ВЫПОЛНЕНИЯ MICROSOFT® REPORT VIEWER 2015 RUNTIME. тогда проблема исчезла.

ХТН

person toha    schedule 17.08.2018
comment
это решило это и для меня сейчас. У меня все работало нормально, пока я не обновил Visual Studio 2019 (думаю, сломал его, но не уверен). Теперь я установил среду выполнения средства просмотра отчетов 2015, а затем перезапустил свой компьютер. Он просто снова начал работать - person Srini; 05.01.2021

Сегодня такая же ошибка:

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 и повторно опубликовать его.

person toha    schedule 09.04.2021