Section report RTF not rendering in CrossPlatform Compatibility mode

Posted by: todd.schellinger on 13 January 2023, 1:03 pm EST

    • Post Options:
    • Link

    Posted 13 January 2023, 1:03 pm EST

    I’ve found that when there is an RTF control on a section report, and attempt to render this through a .net core project, it does not render (it’s blank).

    Looking at some doc, it seems that there is a switch that should be used for that on the section report:

    this.CompatibilityMode = GrapeCity.ActiveReports.Document.CompatibilityModes.CrossPlatform;

    vs

    this.CompatibilityMode = GrapeCity.ActiveReports.Document.CompatibilityModes.GDI;

    When using the CrossPlatform, whether it is in a Framework project or core project, the RTF controls do not render. This can be demonstrated by using the example provided in this other post, and inserting that CrossPlatform line in the designer:

    https://www.grapecity.com/forums/activereports/richtextbox-replacefield-broken-in-16-1-2

    FYI – I am using AR 16.1.2, VS2022, .Net Core 6.0 and a framework project to do preview support in framework 4.7.2.

    Is there a workaround for this, or is this something that has been discovered?

    Thanks!

  • Posted 16 January 2023, 7:11 am EST - Updated 15 February 2023, 10:35 am EST

    Hi Todd,

    This is a known limitation in ActiveReports 16, when using CrossPlatform CompatabilityMode the RichTextBox renders only HTML content. Thus specifying RTF content to RichTextBox at runtime previews nothing, to learn more about the same please refer to RichTextBox https://www.grapecity.com/activereportsnet/docs/versions/v16/online/rich-textbox.html.

    However, specifying plain text or loading your RTF file through the designer converts them to HTML when loading into the RichTextBox control.

    As a workaround in CrossPlatform Compatability please add your RTF content between the body tags and assign it to the Html property of your RichTextBox. Please refer to the following line of code:

    richTextBox1.Html = "<html><body>mytext</body></html>";

    Please find attached a sample implementing the same.

    Apologies for the inconvenience.

    Regards,

    Anand

    RichTextBoxTest.zip

  • Posted 16 January 2023, 4:25 pm EST

    Thanks Anand, I missed that part of the docs.

    I’m able to get them to show up if I convert to html.

  • Posted 17 January 2023, 12:00 am EST

    Hi Todd,

    We’re glad we were able to resolve your issue!

    Regards,

    Anand

  • Posted 25 October 2024, 2:18 am EST

    It’s still not working with ActiveReports 18 and .NET 8.0. The fix doesn’t work for me because we have real RTF and then the HTML just displays the RTF content with all the special formatting characters.

  • Posted 28 October 2024, 6:16 am EST

    Hi Roman,

    Unfortunately, as Microsoft has made RTF legacy we only support using RTF in GDI compatibility mode, as .NET Core runs only on CrossPlatform compatibility the RTF is not rendered, hence it is recommended to use HTML when working with .NET Core.

    You can learn more about this here RichTextBox.

    Regards,

    Anand

Need extra support?

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

Learn More

Forum Channels