Posted 31 March 2025, 2:13 pm EST
Hello,
I have been trying to host my .net 8 project on AWS lambda to generate section reports using Active Reports 17.2.2. It works fine locally, but whenever I run my Lambda function from the AWS console and it hits the SectionReport.Run() function it errors out with this:
Exception occurred while generating the report AUDITLOGReport: System.NullReferenceException: Object reference not set to an instance of an object.
at GrapeCity.ActiveReports.Drawing.Core.FontsFactory.BuildFontCollection(FontInfo fontInfo)
at GrapeCity.ActiveReports.Rendering.Tools.FuncExtensions.<>c__DisplayClass1_0`2.<Memoize>b__0(T x)
at GrapeCity.ActiveReports.FontResolver.CustomDocumentFontsFactory.GrapeCity.ActiveReports.Core.Document.Drawing.Gc.IDocumentFontsFactory.GetFonts(Font font)
at GrapeCity.ActiveReports.Core.Document.Drawing.Gc.GcTextLayoutService.CreateTextFormat(Font font, Color color, Single dpiX, IDocumentFontsFactory fontCache, LineBreakingAlgorithm lineBreaking, TextLayoutParams param, Boolean fontStyleEmulation, Boolean withEudc)
at GrapeCity.ActiveReports.Core.Document.Drawing.Gc.GcTextLayoutService.Layout(String text, Font font, Single width, TextLayoutParams param)
at GrapeCity.ActiveReports.SectionReportModel.TextBox.GrapeCity.ActiveReports.Controls.IControlInternal.FlexSize(SizeF& size)
at GrapeCity.ActiveReports.Internal..ProcessFlexSize(Int32 sectionIndex)
at GrapeCity.ActiveReports.Internal..FormatSection(Section section)
at GrapeCity.ActiveReports.Internal..ProcessPageTillFull()
at GrapeCity.ActiveReports.Internal..GrapeCity.ActiveReports.Layout.IExecReport.RenderPage(Page newPage, Single left, Single top, Single right, Single bottom, ExecMode flags, ExecStatus& status)
at GrapeCity.ActiveReports.SectionReport.ProcessPage()
at GrapeCity.ActiveReports.SectionReport.RunImpl(Boolean syncDocument)
I had figured it couldn’t access any system-level fonts and thus was erroring, so I attempted to create my own IFontResolver implementation and added open source .ttf font files to my .net project as content to return from the GetFonts method. Unfortunatley, utilizing the custom FontResolver yields the same result. I am out of ideas and would appreciate any help. Thanks!