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

  • Posted 1 October 2025, 9:52 am EST

    Any updates on the status of this issue? We encountered another case that causes the report to fail. It is being caused by one or more of the following special hidden characters in the HTML added to the richtextbox: PDF, RLM, LRE. Stack trace is below:

    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​(CharType[] , Int32 , Int32 )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​(IList`1 , IList`1 , CharType[] , )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​( )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​()
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​(SizeF )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​Measure(SizeF a)
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​LayoutBlock( a)
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​(SizeF )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​Measure(SizeF a)
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​LayoutBlock( a)
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​(SizeF )
    at MESCIUS.​ActiveReports.​Core.​Rendering.​I.​.​Measure(SizeF a)
    at GrapeCity.​ActiveReports.​SectionReportModel.​RichTextBox.​GrapeCity.​ActiveReports.​Controls.​IControlInternal.​FlexSize(SizeF& size)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessFlexSize(Int32 sectionIndex)
    at MESCIUS.​ActiveReports.​Internal.​.​FormatSection(Section section)
    at MESCIUS.​ActiveReports.​Internal.​.​PreProcessSectionPhase3(Section section, SectionType sectType)
    at MESCIUS.​ActiveReports.​Internal.​.​PreProcessDetailPhase3(Section section, Boolean& readyForFinalChecks, Boolean& continueLoop)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessSectionPhase3(Section section, Boolean& groupFootersDone, Boolean& readyForFinalChecks)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessPhase3(Boolean& groupFootersDone, Boolean& readyForFinalChecks)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessPageTillFull()
    at MESCIUS.​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 MESCIUS.​ActiveReports.​Internal.​.​ReLayoutItem(Int32 pieceIndex)
    at MESCIUS.​ActiveReports.​Internal.​.​ReLayout()
    at MESCIUS.​ActiveReports.​Internal.​.​AddSection(Section section, Int32 insPos)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessSectionPhase3(Section section, Boolean& groupFootersDone, Boolean& readyForFinalChecks)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessPhase3(Boolean& groupFootersDone, Boolean& readyForFinalChecks)
    at MESCIUS.​ActiveReports.​Internal.​.​ProcessPageTillFull()
    at MESCIUS.​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)

    Thanks,

    Chuck

  • Posted 3 October 2025, 1:47 am EST

    Hi Charles,

    Good News! The issue has been fixed in the latest release v19.1 of ActiveReports, you can get it from here: Download Version History.

    Could you also verify if the hidden character issue persists in the latest release.

    If yes, then please tell us more about the characters you are using that is causing the issue so we can replicate the issue on our end. A sample report/application will be appreciated!

    Regards,

    Anand

Need extra support?

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

Learn More

Forum Channels