Right to Left, Left to Right RTF issues

  • JButcher 5 months, 3 weeks ago

    In an AR10 SectionReport we have some Arabic text which is mixed with left to right text in RTF format (attached), when we put this in a RichTextBox it renders incorrectly.

    So the following text
    عسل(13%) (طحين) السكر
    Renders in the wrong order, as you can see in the screenshot.

    Are there any ways to fix this issue?

    Thanks

    Attachments:
    1. AR-Output

      AR-Output.png

    1. arabic.rtf
  • 18p
    Ruchir Agarwal18p 5 months, 3 weeks ago

    Hello,

    Thank you for reaching out to us and thank you for sharing the rtf file.
    However, there seems to be an issue with the rtf file. We could not replicate the issue with a rtf file created at our end.

    Following are the steps we followed for creating the rtf file and loading the same in RichTextBox control in Active Reports.

    1. Created and open a new MS Word Document.
    2. Copy and pasted the arabic text “عسل(13%) (طحين) السكر” in created word document
    3. Saved the file with rtf extension.
    4. Loaded the saved rtf file in RichTextBox control using LoadFile method.
    5. Previewed the report.

    I have attached a sample report used for reproducing the issue at our end, the rtf file loaded into RichTextBox control and the output generated at our end.

    Also, please share the exact AR version you are using, so that we could replicate the issue at our end and help you further.

    Regards
    Ruchir Agarwal

    Attachments:
    1. AR_ARABIC.zip
  • JButcher 5 months, 3 weeks ago

    Hi Ruchir,

    Thanks for the response, unfortunately we are not the source of the RTF, that comes from our customers. As the rtf in my original post opens correctly in word I think its correct, certainly our customers think its correct. they generate a lot of this kind of text and have similar issues with all Right To Left, Left To Right mixed text.

    Exact version of AR is 10.1.6726.0

    Thanks

  • 18p
    Ruchir Agarwal18p 5 months, 3 weeks ago

    Hello,

    Thank you for sharing your AR version.

    Could you please try creating a copy of the .rtf file you shared before and try loading that .rtf file in RichTextBox control and let us know if you still face the issue.
    Doing the same did not reproduce the issue at our end using the same AR version as yours and thats why we doubt about the correctness of the original .rtf file.
    Note: Please create the copy using File->SaveAs->Other Formats->set type as .rtf

    Is it possible for you to ask your customers how they create these .rtf files, so that we could follow their approach and replicate the issue at our end and help you better.

    Regards
    Ruchir Agarwal

  • JButcher 5 months, 3 weeks ago

    Hi Ruchir,

    Apparently the customer converts html to RTF using SautinSoft’s converter (they do this because AR RichTextBox’s conversion from HTML to RTF doesn’t play nicely with tables btw). The HTML (attached) is generated by CKEditor embedded on a webpage.

    I tried entering the HTML directly into the RichTextBox’s Html property to see how it would treat it and it is also incorrect. You can compare the html opened in chrome to AR’s output.

    I am happy you are looking into this, thanks for taking the time.

    Edit: the html didn’t upload, re-uploaded as .txt
    And here it is pasted so you can see it correctly

     عسل(13%) (طحين) السكر 
    Attachments:
    1. arabic_html.txt
  • 18p
    Ruchir Agarwal18p 5 months, 3 weeks ago

    Hello,

    Thank you for sharing the information.
    I am working on this and will update you soon.

    Till then could you please try creating a copy of the .rtf file you shared before and try loading that .rtf file in RichTextBox control and let us know if you still face the issue.

    Regards
    Ruchir Agarwal

  • JButcher 5 months, 2 weeks ago

    Hi Again,

    I coppied the contents into a new word doc and saved as RTF (attached).
    Its still wrong, different, but wrong, I attached an image of the pdf output.

    Using the rtf attached to your post almost works, its correct except the text isn’t right aligned.

    Any news from your end?

    Thanks

    Attachments:
    1. wordsavedarabicoutputfromAR

      wordsavedarabicoutputfromAR.png

    1. wordsavedarabic.rtf
  • 18p
    Ruchir Agarwal18p 5 months, 2 weeks ago

    Hi,

    We tried using the “SautinSoft” tool for converting the HTML (you shared previously) to a RTF file and the RTF file generated seems to be wrong as its output is very different from that of HTML output.

    I have attached a screen-shot of the HTML in the background and the RTF file output in the front and have also attached the application used for converting the HTML file to RTF, for you to replicate the same at your end.

    Hence, we suggest you to please ask your customer to try using a different approach for converting HTML to RTF and then try loading the RTF in ActiveReports RichTextBox.

    Regards
    Ruchir Agarwal

    Attachments:
    1. HtmlToRtfUsingSautinSoft

      HtmlToRtfUsingSautinSoft.png

    1. SautinSoftHtmlToRtf.zip
  • JButcher 5 months, 2 weeks ago

    Hi Ruchir,

    The RTF I attached in the first post renders correctly in word and is coming from the customer. Its possible that the customer is using different settings to you during the conversion, and obviously they aren’t using a trial version.

    If you enter the html directly into the HTML property of the AR RichTextBox it doesn’t render correctly (attached). There is some issue with the output of RTL, LTR by Active Reports.

    Please don’t just dismiss this.

    Thanks

    Attachments:
    1. arabic_issue.rpx
  • 18p
    Ruchir Agarwal18p 5 months, 1 week ago

    Hello,

    Thank you for putting so much effort and also for sharing the rpx file.
    However, after discussing the issue with the Development team, I would like to inform you that for using SectionReport’s RichTextBox, you need to generate the content by using the specific version of WordPad(preferably version 6.3) because it’s the only rtf provider that is supported.
    We sincerely regret for the inconvenience caused to you in this regard.

    Also, is it possible for you to use PageReport, since the FormattedText might work for your scenario.

    ~Ruchir Agarwal

  • JButcher 5 months, 1 week ago

    Thats unfortunate,

    As it happens I’ve been analyzing the effort required to migrate to PageReports, which isn’t insignificant, and checking how it handles cases like this.

    On PageReports Specifically for this html snippet, I can tell you that the Word output is completely incorrect, worse even than the SectionReport RichTextBox; the pdf is almost correct but places the % sign on the wrong side of the number and the excel output is perfect. All for the exact same input.

    It would be a big deal for us to have this fixed in Section Reports though, we have significant man hours invested into a lot of complex rpx templates.

    Do you have any advise on the generation of WordPad compliant RTF starting from html?

    Thanks

  • 18p
    Ruchir Agarwal18p 5 months, 1 week ago

    Hello,

    I have escalated this issue, “HTML not getting correctly loaded in RichTextBox” to the concerned team. I will update you once I have some information.

    Regards
    Ruchir Agarwal

  • JButcher 5 months, 1 week ago

    Thats good news,

    I look forward to the response.

    Thanks.

  • 18p
    Ruchir Agarwal18p 5 months ago

    Hello,

    For showing some Arabic text properly using SectionReport, you may use the attached HTMLRender class to show the Arabic content on report. You would need to implement HtmlRenderer.RenderBitmap() method, pass the html content as string and use a Picture control for showing the generated image.

    I have attached a sample application for reference.
    Note: You would need to make sure the html is correctly formatted before passing it to RenderBitmap() method.

    Regards
    Ruchir Agarwal

  • JButcher 5 months ago

    Hi Ruchir,

    We actually implemented basically the same solution (html->Image) as a stopgap several months ago, unfortunately our customers have rejected it. They rely on copy pasting the Arabic / Hebrew to other documents and with this solution they are forced to manually re-enter the Arabic, which is done by an offshore office which doesn’t speak either Arabic or Hebrew and of course causes many mistakes.

    Thanks,

    Jonathan

Viewing 15 posts - 1 through 15 (of 28 total)

You must be logged in to reply to this topic.