I am working for the first time with Report viewer for RDLC reports in an ERP in MVVM. The fact is that no one on my team works locally generating reports except for one person. Running your code on my machine works fine for me while mine doesn't. I have looked at all the project files comparing them and I don't see any differences but there must be some. The versions of the Microsoft.Sqlserver.Types
and references Microsoft.Reportviewer
are the same. And there are no references that my partner has that I don't have. The code is the same since we work with version control. The only difference there may be is a new controller or a new model corresponding to ongoing development but nothing else that I have detected.
The exception jumps in this line when I go to read the parameters of the local report:
ReportParameterInfoCollection pInfo = reportViewer.LocalReport.GetParameters();
The exception message isSe ha producido un error durante el procesamiento local de informes.
The inner exception is:
message:
La definición del informe '' no es válida.
Stacktrace:
en Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.CompileReport()
en Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
Source:
Microsoft.ReportViewer.Common
Source:
Microsoft.ReportViewer.WebForms
Stacktrace:
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
en Microsoft.Reporting.WebForms.LocalReport.GetParameters()
en WimbiV2App.Helpers.ReportGenerator.setParametersToLocalReport(ReportConfiguration conf, ReportViewer reportViewer) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 954
en WimbiV2App.Helpers.ReportGenerator.GetReportViewerLocalProcessing(ReportConfiguration conf, ReportViewer reportViewer, Stream transformedTemplateStream) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 594
en WimbiV2App.Helpers.ReportGenerator.GenerateApplicationReport(ReportConfiguration conf) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 558
en WimbiV2App.Helpers.ReportGenerator.GenerateReportFromReportDefinition(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 173
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 120
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(List`1 configurations, Boolean PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs: línea 62
en WimbiV2App.Controllers.DirectCustomerController.PrintInvoiceReports(Nullable`1 companyID, String factMode, Nullable`1 reportType, List`1 reportsSelected, List`1 invoiceToPrint, Nullable`1 visualized) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Controllers\DirectCustomerController.cs: línea 7040
Debugging the code that works and the one that doesn't work, the only difference I find before the error is that in the project that works LocalReport has HasExecutionSession set to true while the one that doesn't work has it set to false. The moment where it is set to true is in the function //Carga el fichero modificado reportViewer.LocalReport.LoadReportDefinition(transformedTemplateStream);
. From there, if you want to inspect the localReport object, you get a message like this:
I don't know if this information can help
Thanks in advance.
The entire exception stack:
System.Exception: Microsoft.Reporting.WebForms.LocalProcessingException: Se ha producido un error durante el procesamiento local de informes. ---> Microsoft.Reporting.DefinitionInvalidException: La definición del informe '' no es válida. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Error inesperado al procesar los informes. ---> System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado.
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType)
en Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Serialize(IntermediateFormatWriter writer)
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(IPersistable persistableObj, Boolean verify)
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj)
en Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets()
en 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)
en 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)
en 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)
en Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext)
en Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.CompileReport()
en Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
en Microsoft.Reporting.WebForms.LocalReport.GetParameters()
en WimbiV2App.Helpers.ReportGenerator.setParametersToLocalReport(ReportConfiguration conf, ReportViewer reportViewer) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 954
en WimbiV2App.Helpers.ReportGenerator.GetReportViewerLocalProcessing(ReportConfiguration conf, ReportViewer reportViewer, Stream transformedTemplateStream) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 594
en WimbiV2App.Helpers.ReportGenerator.GenerateApplicationReport(ReportConfiguration conf) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 558
en WimbiV2App.Helpers.ReportGenerator.GenerateReportFromReportDefinition(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 173
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 120
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(List`1 configurations, Boolean PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 62
en WimbiV2App.Controllers.DirectCustomerController.PrintInvoiceReports(Nullable`1 companyID, String factMode, Nullable`1 reportType, List`1 reportsSelected, List`1 invoiceToPrint, Nullable`1 visualized) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Controllers\DirectCustomerController.cs:línea 7040 ---> Microsoft.Reporting.WebForms.LocalProcessingException: Se ha producido un error durante el procesamiento local de informes. ---> Microsoft.Reporting.DefinitionInvalidException: La definición del informe '' no es válida. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Error inesperado al procesar los informes. ---> System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado.
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType)
en Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Serialize(IntermediateFormatWriter writer)
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(IPersistable persistableObj, Boolean verify)
en Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj)
en Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets()
en 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)
en 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)
en 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)
en Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext)
en Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot)
en Microsoft.Reporting.LocalService.CompileReport()
en Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
en Microsoft.Reporting.WebForms.LocalReport.GetParameters()
en WimbiV2App.Helpers.ReportGenerator.setParametersToLocalReport(ReportConfiguration conf, ReportViewer reportViewer) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 954
en WimbiV2App.Helpers.ReportGenerator.GetReportViewerLocalProcessing(ReportConfiguration conf, ReportViewer reportViewer, Stream transformedTemplateStream) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 594
en WimbiV2App.Helpers.ReportGenerator.GenerateApplicationReport(ReportConfiguration conf) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 558
en WimbiV2App.Helpers.ReportGenerator.GenerateReportFromReportDefinition(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 173
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(ReportConfiguration conf, Document doc, PdfWriter PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 120
en WimbiV2App.Helpers.ReportGenerator.GenerateReport(List`1 configurations, Boolean PDFUnico) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Helpers\ReportGenerator.cs:línea 62
en WimbiV2App.Controllers.DirectCustomerController.PrintInvoiceReports(Nullable`1 companyID, String factMode, Nullable`1 reportType, List`1 reportsSelected, List`1 invoiceToPrint, Nullable`1 visualized) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Controllers\DirectCustomerController.cs:línea 7040
--- Fin del seguimiento de la pila de la excepción interna ---
en WimbiV2App.Controllers.DirectCustomerController.PrintInvoiceReports(Nullable`1 companyID, String factMode, Nullable`1 reportType, List`1 reportsSelected, List`1 invoiceToPrint, Nullable`1 visualized) en C:\Users\pandres\Desktop\Atlas\pas2 - copia (2)\DEV-3-WimbiV2App\WimbiV2App\Controllers\DirectCustomerController.cs:línea 7069