reportviewercore icon indicating copy to clipboard operation
reportviewercore copied to clipboard

Blazor Web Assembly Support.

Open SPEMoorthy opened this issue 3 years ago • 9 comments

Hi @lkosson,

Am trying to generate report in Blazor Client side (WebAssembly), Got Unsupported platform exception. Do you have any roadmap to to support webassembly (Mono engine)?

Easwar

SPEMoorthy avatar Aug 16 '21 12:08 SPEMoorthy

Hello,

Please provide a full stack trace of the exception. I know little about Blazor, but chances of RV compiled to WebAssembly working are slim; most likely limited to HTML, DOCX and XLSX formats only - mostly due to heavy reliance on native Windows DLLs for page layout and typography.

lkosson avatar Aug 16 '21 15:08 lkosson

Hi Sample code in written i a .razor page

image

And the error is like as follows

image

All in Textual format

ReportViewerCore_Error.log

Note :- I also tried with html, excel format also... Same error.

Regards, Easwar

SPEMoorthy avatar Aug 23 '21 13:08 SPEMoorthy

Most likely ReportViewer won't work in Blazor. While the error you've encountered can be fixed (call to Process.GetCurrentProcess() can be removed or guarded when running in Blazor), report compilation using Roslyn won't work due to issues similar to reported in #49 regarding single-exe deployment.

Nevertheless, I'll fix the call in upcoming version. Perhaps at some time I'll come up with a solution to both issues.

lkosson avatar Aug 24 '21 05:08 lkosson

@lkosson , Thanks for prompt reply. Let the Issue open. Will try to fix the problem. This would help a lot for rendering report using the local processing power instead of server resources.

Thanks & Regards, Easwar

SPEMoorthy avatar Aug 24 '21 05:08 SPEMoorthy

Apart from bypassing Process.GetCurrentProcess(), Blazor support requires changes to ExprHostCompiler and VBExpressionCodeProvider to pass runtime and user DLL references to Roslyn compiler in a way that is mutually exclusive with the one used now. It might be possible to fork the ReportViewer to target Blazor environment, but as of now, I see no way of providing a single .nuget package which works both in Blazor and .NET Core.

I'll leave the issue open, perhaps someone can pick it up and maintain such fork of this project.

lkosson avatar Aug 25 '21 12:08 lkosson

I'm working with it on Blazor Server Side, API .NET Core and Front End in Blazor Server Side. This work perfectly, try to put the report.rdlc on [wwwroot] folder in the API project:

Screenshot_3

Then, in the , create a generic report base, in the controller just call this report base.

image

then from the controller call the report

image

Sorry for the spanish words on the pics

luisbillr avatar Mar 31 '22 18:03 luisbillr