RichTextBox error with an emojy in HTML

Posted by: alexander.kainz on 15 March 2023, 10:04 pm EST

    • Post Options:
    • Link

    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: :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 16 March 2023, 5:47 pm 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

Need extra support?

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

Learn More

Forum Channels