Is there a way to load a template for a sub-report?

I want to create a footer with company data which needs to be embedded on all reports, but I'd rather not copy that to each report.

If I could use a report template for it and assign it to a subreport then I'd only need to create it once, and if something changes, it would only need to be changed once.

Regards

Comments

  • Hello!

    We have a good video about report inheritance:

    https://www.youtube.com/watch?v=8TsOQ28maN8

  • Hi, thx, that worked!

    I now seem to have an issue deploying to the server. The fonts are not loading. I tried adding an event handler to the TrueTypeCollection.OnGetFontPath but my font "NeoSans" never passes through that function.

    <TextObject Name="Text1" ZOrder="7" Top="56.7" Width="47.25" Height="9.45" Text="Invoice number:" VertAlign="Center" Font="Neo Sans Std, 4pt"/>

    The reports are included in a .net Core 3 project, running on a Mac for now but should run from a docker container.

  • Hello!

    To use a single, updatable footer/header template across all reports, it’s best to use report inheritance (report.BaseReport = “common_footer.frx”;) this allows you to change the footer in a single base .frx file without duplication.

    Regarding your second question (the custom Neo Sans Std font does not load when deploying .NET Core 3 in Docker / macOS, and TrueTypeCollection.OnGetFontPath is not called):

    In the current version of FastReport.Core, it is recommended to register custom fonts directly via FastReport.Utils.Config.FontManager.AddFont(“path/to/NeoSansStd.ttf”) (formerly PrivateFontCollection) when the application starts and to specify the exact FamilyName of the font (as seen by the OS) in the template. https://www.fast-report.com/blogs/fonts-reports-without-installing

    On Linux/Docker, for correct rendering of non-standard .ttf/.otf fonts without issues with GDI+ / libgdiplus, use FastReport.Core.Skia and ensure that the font files have a lowercase .ttf extension and are readable by the process.

This discussion has been closed.