Page 1 of 1

Render Report on Linux with .NET Core?

Posted: Thu Feb 27, 2020 10:50 am
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 ;)

Re: Render Report on Linux with .NET Core?

Posted: Thu Feb 27, 2020 9:17 pm
by Lech Kulikowski
Hello,

You should install libgdiplus library on your linux server.

Thank you.

Re: Render Report on Linux with .NET Core?

Posted: Fri Feb 28, 2020 11:42 am
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()

Re: Render Report on Linux with .NET Core?

Posted: Thu Mar 12, 2020 7:15 am
by ednt
Is there no solution? :(

Re: Render Report on Linux with .NET Core?

Posted: Mon Mar 16, 2020 10:45 pm
by HighAley
Hello,

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

Code: Select all

StiOptions.Export.Pdf.AllowImportSystemLibraries
Thank you.

Re: Render Report on Linux with .NET Core?

Posted: Wed Apr 22, 2020 12:50 pm
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?

Re: Render Report on Linux with .NET Core?

Posted: Mon Apr 27, 2020 11:02 am
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.