Closed AlanMichaelDobson closed 3 years ago
There seems to be an expression in your report that directly or indirectly uses regexes. Please inspect your RDLC for such expression and provide it here so I can replicate the issue locally. Most likely cause is missing assembly reference in VB compiler invocation. In .NET Framework System.Text.RegularExpressions used to live in System.dll, now it is in (unreferenced) System.Text.RegularExpressions.dll.
Hi
Below is the only regex in the XML for the report
Public Function ConvertRtfToTextRegex(ByVal input As String) As String
Dim returnValue As String = String.Empty
returnValue = System.Text.RegularExpressions.Regex.Replace(input, "{*?\[^{}]+}|[{}]|\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
Return returnValue
End Function
Strange that it references System.Text.RegularExpressions
I have added System.Text.RegularExpressions.dll assembly reference to Roslyn compiler input. Please check if this solves the issue.
Hi
I am getting this error CustomCode(2) : error BC30456: 'RegularExpressions' is not a member of 'System.Text'. in code that ran successfully under .Net Framework but fails under .Net 5 If required I will happily narrow down in a test harness if the data below is not enough
Thank you Alan Dobson
Local property
public Microsoft.Reporting.WinForms.LocalReport Report { get; private set; }
Error Call
this.Report.GetDataSourceNames()
Failure method
public void SetDataSet(DataSet dataset) { this.DataSet = dataset;
}
Exception details from the debugger
Microsoft.Reporting.WinForms.LocalProcessingException HResult=0x80131500 Message=An error occurred during local report processing. Source=Microsoft.ReportViewer.WinForms StackTrace: at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession() at Microsoft.Reporting.WinForms.LocalReport.GetDataSourceNames() at SDS.Optical.Windows.BPL.Reports.SDSLocalReport.SetDataSet(DataSet dataset) in E:\Release_60\ClassLibraries\SDS.Optical.Windows.BPL\Reports\SDSLocalReport.cs:line 195
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: DefinitionInvalidException: The definition of the report '' is invalid.
Inner Exception 2: ReportProcessingException: An unexpected error occurred in Report Processing.
Inner Exception 3: InvalidOperationException: CustomCode(2) : error BC30456: 'RegularExpressions' is not a member of 'System.Text'.
More comprehensive stack trace from our QA team
ExceptionType: Microsoft.Reporting.WinForms.LocalProcessingException TargetSite: Void EnsureExecutionSession() Message: An error occurred during local report processing. Data: HelpLink: NULL Source: Microsoft.ReportViewer.WinForms HResult: -2146233088 StackTrace: at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession() at Microsoft.Reporting.WinForms.LocalReport.GetDataSourceNames() at SDS.Optical.Windows.BPL.Reports.SDSLocalReport.SetDataSet(DataSet dataset) at SDS.Optical.Windows.BPL.Reports.SDSWinFormsReportingBPL.SetReport(SDSReportingBPL sdsReportingBPL, LocalReport report, DataSet dataset, Hashtable parameters, SystemAuditEvent startPrintingSystemAuditEvent) at SDS.Optical.Windows.Reports.Forms.ReportPreviewRPLFormCode.SetReport(SDSReportingBPL reportingBPL, DataSet reportData, Hashtable parameters, SystemAuditEvent startPrintingSystemAuditEvent) at SDS.Optical.Windows.Reports.Forms.ReportPreviewRPLFormCode.SetReport(SDSReportingBPL reportBPL) at SDS.Optical.Windows.Billing.Forms.BillingPaymentAllocation2FormCode.OpenBookPage()
ExceptionType: Microsoft.Reporting.DefinitionInvalidException Message: The definition of the report '' is invalid. ExceptionLevelHelpLink: https://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=pvInvalidDefinition&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=1.0 SkipTopLevelMessage: False Code: pvInvalidDefinition AdditionalTraceMessage: NULL ExceptionData: TargetSite: Microsoft.ReportingServices.ReportProcessing.PublishingResult CompileReport(Microsoft.ReportingServices.Diagnostics.ICatalogItemContext, Byte[], Boolean, Microsoft.ReportingServices.Library.ControlSnapshot ByRef) Data: HelpLink: NULL Source: Microsoft.ReportViewer.Common HResult: -2146233088 StackTrace: 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()
ExceptionType: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException ProcessingMessages: NULL Message: An unexpected error occurred in Report Processing. ExceptionLevelHelpLink: https://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsInternalError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=1.0 SkipTopLevelMessage: False Code: rsInternalError AdditionalTraceMessage: NULL ExceptionData: TargetSite: Microsoft.ReportingServices.ReportProcessing.PublishingResult CreateIntermediateFormat(Microsoft.ReportingServices.ReportProcessing.PublishingContext) Data: HelpLink: NULL Source: Microsoft.ReportViewer.Common HResult: -2146233088 StackTrace: at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext) at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
Launch book page report
ExceptionType: System.InvalidOperationException TargetSite: System.CodeDom.Compiler.CompilerResults CompileAssemblyFromDom(System.CodeDom.Compiler.CompilerParameters, System.CodeDom.CodeCompileUnit[]) Message: CustomCode(2) : error BC30456: 'RegularExpressions' is not a member of 'System.Text'. Data: HelpLink: NULL Source: Microsoft.ReportViewer.Common HResult: -2146233079 StackTrace: at Microsoft.ReportingServices.RdlExpressions.VBExpressionCodeProvider.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit[] compilationUnits) at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile(AppDomain compilationTempAppDomain, Boolean refusePermissions) at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.<>c__DisplayClass46_0.b__0()
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomain compilationTempAppDomain, Boolean refusePermissions, PublishingVersioning versioning)
at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3(ParameterInfoCollection& parameters, Dictionary`2& groupingExprCountAtScope)
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, 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)