Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor Web Assembly Support. #56

Open
SPEMoorthy opened this issue Aug 16, 2021 · 9 comments
Open

Blazor Web Assembly Support. #56

SPEMoorthy opened this issue Aug 16, 2021 · 9 comments

Comments

@SPEMoorthy
Copy link

SPEMoorthy commented Aug 16, 2021

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

@lkosson
Copy link
Owner

lkosson commented Aug 16, 2021

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.

@SPEMoorthy
Copy link
Author

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

@lkosson
Copy link
Owner

lkosson commented Aug 24, 2021

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.

@SPEMoorthy
Copy link
Author

@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

@lkosson
Copy link
Owner

lkosson commented Aug 25, 2021

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.

@luisbillr
Copy link

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

@won5572
Copy link

won5572 commented Nov 17, 2023

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

Did it work on Blazor Server Side & Docker & Linux?
I got this error. How can I fix this?

An unhandled exception occurred while processing the request.
DllNotFoundException: Unable to load shared library 'usp10.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/usp10.dll.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net8.0/usp10.dll.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/libusp10.dll.so: cannot open shared object file: No such file or directory
/app/bin/Debug/net8.0/libusp10.dll.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/usp10.dll: invalid ELF header
/app/bin/Debug/net8.0/usp10.dll: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/libusp10.dll: cannot open shared object file: No such file or directory
/app/bin/Debug/net8.0/libusp10.dll: cannot open shared object file: No such file or directory
Microsoft.ReportingServices.Rendering.RichText.Win32.ScriptItemize(string pwcInChars, int cInChars, int cMaxItems, ref SCRIPT_CONTROL psControl, ref SCRIPT_STATE psState, out SCRIPT_ITEM[] pItems, ref int pcItems)

LocalProcessingException: An error occurred during local report processing.
Microsoft.Reporting.NETCore.LocalReport.InternalRender(string format, bool allowInternalRenderers, string deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, out Warning[] warnings)

This is the part of my Dockerfile.

RUN apt-get update
&& apt-get install -y wine --no-install-recommends libgdiplus
&& ln -s /usr/lib/libgdiplus.so /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/
&& ln -s /usr/lib/x86_64-linux-gnu/wine/x86_64-windows/usp10.dll /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.0/

@lkosson
Copy link
Owner

lkosson commented Nov 17, 2023

It looks like you are using Linux version of .NET. PDF rendering won't work in such environment. You have to use .NET for Windows with Wine. See "Linux rendering workaround" section in readme.

@won5572
Copy link

won5572 commented Nov 20, 2023

I understood your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants