Font not found after upgrade from 2024.2.4 to 2026.1.2

Stimulsoft Reports.NET discussion
Post Reply
Sigmund
Posts: 2
Joined: Mon Oct 28, 2024 2:42 pm

Font not found after upgrade from 2024.2.4 to 2026.1.2

Post by Sigmund »

Hi,

we upgraded, now some reports not load because of null Reference exception. If i change the font from "Arial Narrow" to "Arial" it is working fine. Arial Narrow is installed on the system.
* We also use the JS version there the "Arial Narrow" makes no problems
* The Designer is installed on that system where the report is generated with the dotnet version. The designer see the "Arial Narrow"
* The report is generated in a IIS backend


System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Stimulsoft.Drawing
StackTrace:
at Stimulsoft.Drawing.FontFamily.get_Name()
at Stimulsoft.Base.StiFontCollection.GetFontFamily(String fontName, FontStyle baseFontStyle, Boolean allowNullResult)
at Stimulsoft.Base.StiJsonReportObjectHelper.Deserialize.Font(String text, Font defaultFont)
at Stimulsoft.Base.StiJsonReportObjectHelper.Deserialize.Font(JProperty prop, Font defaultFont)
at Stimulsoft.Base.StiJsonReportObjectHelper.DeserializeFont(JProperty property, Font defaultFont)
at Stimulsoft.Report.Components.StiText.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiComponentsCollection.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiContainer.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiBand.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiPageHeaderBand.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiComponentsCollection.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiContainer.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiPanel.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiPage.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.Components.StiPagesCollection.LoadFromJsonObjectInternal(JObject propJObject)
at Stimulsoft.Report.Components.StiPagesCollection.LoadFromJsonObject(JObject jObject)
at Stimulsoft.Report.StiReport.LoadFromJsonInternal(Stream stream)
at Stimulsoft.Report.StiReport.LoadFromJson(Stream stream)
at Stimulsoft.Report.StiReport.LoadFromJson(String json)
Lech Kulikowski
Posts: 7625
Joined: Tue Mar 20, 2018 5:34 am

Re: Font not found after upgrade from 2024.2.4 to 2026.1.2

Post by Lech Kulikowski »

Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
Sigmund
Posts: 2
Joined: Mon Oct 28, 2024 2:42 pm

Re: Font not found after upgrade from 2024.2.4 to 2026.1.2

Post by Sigmund »

Ok, i found my problem. In GDI mode i have to register all fonts i want to use. Some was registered but not Arial black and narrow.
The old version seems to silently fall back to Arial if the font was not registered.

A helpful error message instead of "Null Reference exception" would be very nice. Something like "Font Arial Black must be registered in GDI Render mode. See StiFontCollection.AddFontBytes(...)"
Attachments
Report.zip
(98.55 KiB) Downloaded 8 times
Lech Kulikowski
Posts: 7625
Joined: Tue Mar 20, 2018 5:34 am

Re: Font not found after upgrade from 2024.2.4 to 2026.1.2

Post by Lech Kulikowski »

Hello,

Thank you for the information.

We have added this task to our to-do list.

Thank you.
#19375
Post Reply