Report Viewer in shadow DOM

Stimulsoft Reports.BLAZOR discussion
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Thanks
Max Shamanov
Posts: 1120
Joined: Tue Sep 07, 2021 10:11 am

Re: Report Viewer in shadow DOM

Post by Max Shamanov »

Hello,

We have made several fixes, and fonts should now display correctly in Print-Print mode.
Please load the fonts you use into StiFontCollection.
You will also need to enable the following option:

Code: Select all

AllowLoadingCustomFontsToClientSide = true
.
You should specify it in the Designer options as follows:

Code: Select all

public StiBlazorDesignerOptions Options = new StiBlazorDesignerOptions()
{
       Server =
    {
        AllowLoadingCustomFontsToClientSide = true
    }
};
Please check our next build once it becomes available.


Thank you.
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Thanks
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Hello Max,

i have checked my Designer options and i already have below configurations:

Code: Select all

 await Assembly.GetExecutingAssembly().InitializeStimulsoftLicenceAsync();
 
Options = new StiBlazorDesignerOptions();
Options.Server.AllowLoadingCustomFontsToClientSide = true;
Options.Appearance.DefaultUnit = StiReportUnitType.Millimeters;
Options.Behavior.UndoMaxLevel = 3;

 // Kjino font
 using var kjinoStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.Kjino.ttf");
 using var kjinoMemoryStream = new MemoryStream();
 await kjinoStream.CopyToAsync(kjinoMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Kjino", Convert.ToBase64String(kjinoMemoryStream.ToArray()));

 // Noto Naskh Arabic font
 using var notoNaskhArabicStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.NotoNaskhArabic.ttf");
 using var notoNaskhArabicMemoryStream = new MemoryStream();
 await notoNaskhArabicStream.CopyToAsync(notoNaskhArabicMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Noto Naskh Arabic", Convert.ToBase64String(notoNaskhArabicMemoryStream.ToArray()));

 // Parwarda font
 using var parwardaStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.Parwarda.ttf");
 using var parwardaMemoryStream = new MemoryStream();
 await parwardaStream.CopyToAsync(parwardaMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("Parwarda", Convert.ToBase64String(parwardaMemoryStream.ToArray()));

 // KRD font
 using var krdStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.KRD.ttf");
 using var krdMemoryStream = new MemoryStream();
 await krdStream.CopyToAsync(krdMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("KRD", Convert.ToBase64String(krdMemoryStream.ToArray()));

 // KRD Bold font
 using var krdBoldStream = assembly.GetManifestResourceStream($"SoftMax.Core.Assets.Fonts.KRD-Bold.ttf");
 using var krdBoldMemoryStream = new MemoryStream();
 await krdBoldStream.CopyToAsync(krdBoldMemoryStream);
 Stimulsoft.Base.StiFontCollection.AddFontBase64("KRD Bold", Convert.ToBase64String(krdBoldMemoryStream.ToArray()));
 
 Report = await Repository.LoadReportAsync(Id);
 StateHasChanged();

so, do i have to wait for the next update to those configs take effect? and does those settings affect the ReportViewer too, to fix the font issue?
Max Shamanov
Posts: 1120
Joined: Tue Sep 07, 2021 10:11 am

Re: Report Viewer in shadow DOM

Post by Max Shamanov »

Hello,

Yes, you should wait for the next major release.
If you are using ReportViewer separately from the designer, you should specify these options too for the viewer.

Thank you.
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Hello,

Yes, the ReportViewer is separate, but the option ( AllowLoadingCustomFontsToClientSide ) is not available for ReportVIewer.
Max Shamanov
Posts: 1120
Joined: Tue Sep 07, 2021 10:11 am

Re: Report Viewer in shadow DOM

Post by Max Shamanov »

Hello,

For the viewer, you should use the following code:

Code: Select all

public StiBlazorViewerOptions Options = new StiBlazorViewerOptions()
{
    Server =
{
    AllowLoadingCustomFontsToClientSide = true
}
};
Thank you.
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Hello Max,

I have updated to the latest version 2026.1.5, but I am still experiencing issues with custom referenced fonts in Print-Print. This problem is preventing my production application from being used, as printing is not possible due to no font being applied. Please review the attached screenshot and report file.

Also I have applied all the mentioned options for the Viewer and the Designer like loading the fonts to StiFontCollection and AllowLoadingCustomFontsToClientSide.

Thank you.
test.mrt
(256.82 KiB) Downloaded 82 times
Screenshot 2026-03-12 112108.jpg
Screenshot 2026-03-12 112108.jpg (436.23 KiB) Viewed 17031 times
Max Shamanov
Posts: 1120
Joined: Tue Sep 07, 2021 10:11 am

Re: Report Viewer in shadow DOM

Post by Max Shamanov »

Hello,

As mentioned earlier, this fix will be included in the next major version 2026.2.1.
Please check it when it becomes available.

Thank you.
User avatar
noob
Posts: 61
Joined: Sat Feb 05, 2022 9:03 am
Location: Iraq, Erbil

Re: Report Viewer in shadow DOM

Post by noob »

Good, when that version will be available?

Thanks
Post Reply