Render Report on Linux with .NET Core?

Stimulsoft Reports.NET discussion
Post Reply
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Render Report on Linux with .NET Core?

Post by ednt »

Hello,
is it possible to render and export a report as pdf on a linux server with the nuget package Stimulsoft.Reports.Engine.NetCore?
Is it generally possible to render and export a report on linux?

At the moment we get the error:

Unable to load shared library 'gdi32.dll'

A dll on Linux is not the right lib format ;)
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Render Report on Linux with .NET Core?

Post by Lech Kulikowski »

Hello,

You should install libgdiplus library on your linux server.

Thank you.
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: Render Report on Linux with .NET Core?

Post by ednt »

Hello,
We have libgdiplus installed on our server.
But we get this error:

Code: Select all

#ls -al /usr/lib/libgdi*
lrwxrwxrwx 1 root root     19 Feb 13  2017 /usr/lib/libgdiplus.so -> libgdiplus.so.0.0.0
lrwxrwxrwx 1 root root     19 Feb 13  2017 /usr/lib/libgdiplus.so.0 -> libgdiplus.so.0.0.0
-rw-r--r-- 1 root root 423896 Feb 13  2017 /usr/lib/libgdiplus.so.0.0.0
#
#./Report
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'gdi32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdi32.dll: cannot open shared object file: No such file or directory
   at Stimulsoft.Report.Export.PdfFonts.DeleteObject(IntPtr objectHandle)
   at Stimulsoft.Report.Export.PdfFonts.GetFontMetricsFullTrust(Font font, PdfFontInfo currentFontInfo, UInt16[] glyphMap, Boolean isWpf)
   at Stimulsoft.Report.Export.PdfFonts.GetFontMetrics(Font font, PdfFontInfo currentFontInfo, UInt16[] glyphMap, Boolean isWpf)
   at Stimulsoft.Report.Export.PdfFonts.InitFontsData(Boolean isWpf)
   at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
   at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
   at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
   at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
   at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream)
   at Report_Dispatcher_CS.Utils.StimulsoftUtils.CreateStiReportPdfStream(report report)
   at Report_Dispatcher_CS.Classes.Worker.SendPdfToMail(users_report usersReport)
   at Report_Dispatcher_CS.Classes.Worker.Start()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: Render Report on Linux with .NET Core?

Post by ednt »

Is there no solution? :(
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Render Report on Linux with .NET Core?

Post by HighAley »

Hello,

Please, check the next option. It should be disabled.

Code: Select all

StiOptions.Export.Pdf.AllowImportSystemLibraries
Thank you.
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: Render Report on Linux with .NET Core?

Post by ednt »

Hello,
first thank you for your reply!
Yes now it works under linux, but we have an other problem, now.
We create the reports with our stimulsoft-app under windows, but if we send them via email we render the report under linux.
But now the Fonts are false.
The question is: How can i store the fonts in the reports in our windows-client and use them under linux to render the report?
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Render Report on Linux with .NET Core?

Post by Lech Kulikowski »

Hello,

You can add fonts in the report resources or in font collection by the code:
Stimulsoft.Base.StiFontCollection.AddFontFile("font.ttf");

Thank you.
Post Reply