Posted 15 March 2023, 10:04 pm EST
Hello,
I got an error with the richtextbox control in my codebased section report.
We use AR 16.4.0
There is the following emoji in a HTML:
I got this error
---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at GrapeCity.ActiveReports.Core.Rendering.I..(CharType[] , Int32 , Int32 )
at GrapeCity.ActiveReports.Core.Rendering.I..(IList`1 , IList`1 , CharType[] , )
at GrapeCity.ActiveReports.Core.Rendering.I..(IList`1 , IList`1 , CharType[] , )
at GrapeCity.ActiveReports.Core.Rendering.I..( )
at GrapeCity.ActiveReports.Core.Rendering.I..()
at GrapeCity.ActiveReports.Core.Rendering.I..(SizeF )
at GrapeCity.ActiveReports.Core.Rendering.I..LayoutBlock( flow)
at GrapeCity.ActiveReports.Core.Rendering.I..(SizeF )
at GrapeCity.ActiveReports.Core.Rendering.I..LayoutBlock( flow)
at GrapeCity.ActiveReports.Core.Rendering.I..(SizeF )
at GrapeCity.ActiveReports.Core.Rendering.I..Measure(SizeF maxSize)
at GrapeCity.ActiveReports.SectionReportModel.RichTextBox.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..PreProcessSectionPhase3(Section section, SectionType sectType)
at GrapeCity.ActiveReports.Internal..PreProcessDetailPhase3(Section section, Boolean& readyForFinalChecks, Boolean& continueLoop)
at GrapeCity.ActiveReports.Internal..ProcessSectionPhase3(Section section, Boolean& groupFootersDone, Boolean& readyForFinalChecks)
at GrapeCity.ActiveReports.Internal..ProcessPhase3(Boolean& groupFootersDone, Boolean& readyForFinalChecks)
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.SectionReportModel.Section.SR_QueryLayout(SectionReport parentReport, rData)
at GrapeCity.ActiveReports.Internal..ReLayoutItem(Int32 pieceIndex)
at GrapeCity.ActiveReports.Internal..ReLayout()
at GrapeCity.ActiveReports.Internal..AddSection(Section section, Int32 insPos)
at GrapeCity.ActiveReports.Internal..ProcessSectionPhase3(Section section, Boolean& groupFootersDone, Boolean& readyForFinalChecks)
at GrapeCity.ActiveReports.Internal..ProcessPhase3(Boolean& groupFootersDone, Boolean& readyForFinalChecks)
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.SectionReportModel.Section.SR_QueryLayout(SectionReport parentReport, rData)
at GrapeCity.ActiveReports.Internal..ReLayoutItem(Int32 pieceIndex)
at GrapeCity.ActiveReports.Internal..ReLayout()
at GrapeCity.ActiveReports.Internal..AddSection(Section section, Int32 insPos)
at GrapeCity.ActiveReports.Internal..ProcessSectionPhase3(Section section, Boolean& groupFootersDone, Boolean& readyForFinalChecks)
at GrapeCity.ActiveReports.Internal..ProcessPhase3(Boolean& groupFootersDone, Boolean& readyForFinalChecks)
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)
at Liebherr.Cscc.Lios.PdfGenerator.Reports.Services.ReportService.GetTicket(TicketProp ticketProp) in C:\repos\LiOS\LiOS-Report\Liebherr.Cscc.Lios.PdfGenerator\Liebherr.Cscc.Lios.PdfGenerator.Reports\Services\ReportService.cs:line 43
--- End of inner exception stack trace ---
If i replaced the emoji with an empty string, than its ok.
text = Regex.Replace(text, @"\p{Cs}", "")
I think its a bug in AR.