Hi, unfortunately after updating the reportviewer nuget package to the latest version 150.1449.0 I still get the same erorr
I say again, from my C# program it works fine, even with previous reportviewer version.
The problem arise when I run the code from a Powershell script which does strictly the same as the C# program.
What is weird is that Powershell relies on the same dotnet libraries, that I load before render:
$BasePath = Get-Location
Get-ChildItem ("$BasePath\*") -Include *.dll | ForEach-Object {
#[void]@{rvDll = $_.fullname}
@{rvDll = $_.fullname}
Add-Type -Path $_.fullname
#(Get-Command ($_.fullname)).FileVersionInfo.FileVersion
}
try
{
ForEach ($rvDll in $rvDlls) {
# Add assembly DLL
Add-Type -Path ("$BasePath\$rvDll")
}
#(Get-Command ($assemblyPath)).FileVersionInfo.FileVersion
}
Catch {
$error[0].Exception.GetBaseException().LoaderExceptions
}
But if I remove the following expression = "Echéances dues au : " + Format(Now(), "dd/MM/yyyy")
from the textbox in the report, the PS script runs fine.
Output from Powershell console:
Exception levéé durant render :
Exception lors de l'appel de « Render » avec « 1 » argument(s) : « Une erreur s'est produite lors du traitement du rapport local. »
à System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
à System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
à System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
à System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Exception inner :
Une erreur s'est produite lors du traitement du rapport local.
à Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
à Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
à Microsoft.Reporting.WinForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
à CallSite.Target(Closure , CallSite , Object , String )
Exception inner inner:
Échec du chargement de l'assembly hôte d'expressions. Détails : Impossible de charger le fichier ou l'assembly 'Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ou une de ses dépendances. Le fichier spécifié est introuvable.
à Microsoft.ReportingServices.RdlExpressions.ReportRuntime.ProcessLoadingExprHostException(ObjectType assemblyHolderObjectType, Exception e, ProcessingErrorCode errorCode)
à Microsoft.ReportingServices.RdlExpressions.ReportRuntime.LoadCompiledCode(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, Boolean includeParameters, Boolean parametersOnly, ObjectModelImpl reportObjectModel, ReportRuntimeSetup runtimeSetup)
à Microsoft.ReportingServices.OnDemandProcessing.Merge.Init(Boolean includeParameters, Boolean parametersOnly)
à Microsoft.ReportingServices.OnDemandProcessing.Merge.Init(ParameterInfoCollection parameters)
à Microsoft.ReportingServices.ReportProcessing.Execution.ProcessReportOdp.CreateReportInstance(OnDemandProcessingContext odpContext, OnDemandMetadata odpMetadata, ReportSnapshot reportSnapshot, Merge& odpMerge)
à Microsoft.ReportingServices.ReportProcessing.Execution.ProcessReportOdp.Execute(OnDemandProcessingContext& odpContext) à Microsoft.ReportingServices.ReportProcessing.Execution.RenderReportOdpInitial.ProcessReport(ProcessingErrorContext errorContext, ExecutionLogContext executionLogContext, UserProfileState& userP
rofileState)
à Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer)
à Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory yukonCompiledDefinition)
à Microsoft.Reporting.LocalService.CreateSnapshotAndRender(ReportProcessing repProc, IRenderingExtension renderer, ProcessingContext pc, RenderingContext rc, SubreportCallbackHandler subreportHandler, ParameterInfoCollection parameters, DatasourceCredentialsCollection credentials)
à Microsoft.Reporting.LocalService.Render(String format, String deviceInfo, String paginationMode, Boolean allowInternalRenderers, IEnumerable dataSources, CreateAndRegisterStream createStreamCallback)
à Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
Olivier