Report Viewer in shadow DOM
-
Max Shamanov
- Posts: 1110
- Joined: Tue Sep 07, 2021 10:11 am
Re: Report Viewer in shadow DOM
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:.
You should specify it in the Designer options as follows:
Please check our next build once it becomes available.
Thank you.
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 = trueYou should specify it in the Designer options as follows:
Code: Select all
public StiBlazorDesignerOptions Options = new StiBlazorDesignerOptions()
{
Server =
{
AllowLoadingCustomFontsToClientSide = true
}
};Thank you.
Re: Report Viewer in shadow DOM
Hello Max,
i have checked my Designer options and i already have below configurations:
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?
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: 1110
- Joined: Tue Sep 07, 2021 10:11 am
Re: Report Viewer in shadow DOM
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.
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.
Re: Report Viewer in shadow DOM
Hello,
Yes, the ReportViewer is separate, but the option ( AllowLoadingCustomFontsToClientSide ) is not available for ReportVIewer.
Yes, the ReportViewer is separate, but the option ( AllowLoadingCustomFontsToClientSide ) is not available for ReportVIewer.
-
Max Shamanov
- Posts: 1110
- Joined: Tue Sep 07, 2021 10:11 am
Re: Report Viewer in shadow DOM
Hello,
For the viewer, you should use the following code:
Thank you.
For the viewer, you should use the following code:
Code: Select all
public StiBlazorViewerOptions Options = new StiBlazorViewerOptions()
{
Server =
{
AllowLoadingCustomFontsToClientSide = true
}
};