RichTextBox error with an emojy in HTML

Posted by: alexander.kainz on 16 March 2023, 7:04 am EST

    • Post Options:
    • Link

    Posted 16 March 2023, 7:04 am 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: :blush:

    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.

  • Posted 17 March 2023, 2:47 am EST

    Hi Alexander,

    We tried to replicate the issue on our end by creating a Code-Based SectionReport using ActiveReports 16.4.0 and using the ‘:blush:’ emoji within the HTML of a RichTextBox control.

    However, we were not able to replicate the issue on our end.

    We have attached a sample, you may refer/modify the same as per your requirements.

    Regards,

    Anand

    HTML_Emoji.zip

  • Posted 2 June 2025, 10:10 am EST - Updated 2 June 2025, 2:54 pm EST

    Here is an example of HTML emojis / symbols that cause the section report to fail on SectionReport.Run() or in the viewer (now in AR 18.1.1)

    Edit: The “push pin” symbol in the example HTML used for the report seems to be what’s causing the exception. The other symbols render correctly if the push pin is removed.

    HTML_Emoji.zip

  • Posted 6 June 2025, 1:15 am EST

    Hi Charles,

    Thanks for the sample application. We were able to replicate the issue by stripping down the HTML to only

    <html><body><div><p>📌<span>Additional Text</span></p></div></body></html>
    

    We could observe that removing either the emoji or the span tag does not give the error.

    We have escalated the issue to our development team [Internal tracking ID: AR-35848] and will let you know of any updates regarding the same.

    Thanks,

    Anand

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels