Will it be possible to print more advanced rtf fields?

One known limitation of Report Builder is that it "relies on Delphi RichEdit capabilities to render rtf code".

I try to express myself better:

rtf content created with a TDBRichEdit component is printed perfectly in a report's TppDBRichEdit field.
in my applciations i use DevExpress TcxDBRichEdit components that support a more advanced rtf format, for example this kind of "graphics" is not supported by TDBRichEdit:

The table above is given by the rtf content (i copy it directly from the database field and i paste at the end of this post.

When ReportBuilder prints these rtf data this is the result:

The difference between the two is obvious.

I would like that as DevExpress made it also Digital Metaphors does it, somehow having a RTF decoding that is more advanced than the Delphi one.

Since many customers are asking for this I ask you.

I use Delphi 10 and RB 19.03.

Could you please update me on this subject?

Thanks a lot.

RTF code (taken from DB field) that renders the green table:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq2\fcharset0 Calibri;}{\f2\fnil Tahoma;}} {\colortbl ;\red255\green255\blue255;\red0\green0\blue0;\red112\green173\blue71;} {\*\generator Riched20 10.0.17134}\viewkind4\uc1\trowd\trgaph70\trleft30\trbrdrl\brdrs\brdrw60 \trbrdrt\brdrs\brdrw60 \trbrdrr\brdrs\brdrw60 \trbrdrb\brdrs\brdrw60 \trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clcbpat3\clbrdrl\brdrw60\brdrs\brdrcf3\clbrdrt\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw45\brdrs\brdrcf1 \cellx1946\clcbpat3\clbrdrt\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw45\brdrs\brdrcf1 \cellx4111\clcbpat3\clbrdrt\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw45\brdrs\brdrcf1 \cellx5778\clcbpat3\clbrdrt\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw45\brdrs\brdrcf1 \cellx7693\clcbpat3\clbrdrt\brdrw60\brdrs\brdrcf3\clbrdrr\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw45\brdrs\brdrcf1 \cellx9608 \pard\intbl\widctlpar\cf1\b\f1\fs22\lang1040 Very rich table\cell\cell\cell\cell\cell\row\trowd\trgaph70\trleft30\trbrdrl\brdrs\brdrw60 \trbrdrt\brdrs\brdrw60 \trbrdrr\brdrs\brdrw60 \trbrdrb\brdrs\brdrw60 \trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clcbpat3\clbrdrl\brdrw60\brdrs\brdrcf3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrr\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx1946\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx4111\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx5778\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx7693\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrr\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx9608 \pard\intbl\widctlpar 1\cell\b0 This is an example\cell\cell\cell\cell\row\trowd\trgaph70\trleft30\trbrdrl\brdrs\brdrw60 \trbrdrt\brdrs\brdrw60 \trbrdrr\brdrs\brdrw60 \trbrdrb\brdrs\brdrw60 \trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clcbpat3\clbrdrl\brdrw60\brdrs\brdrcf3\clbrdrr\brdrw10\brdrs\brdrcf1 \cellx1946\clcbpat3\cellx4111\clcbpat3\cellx5778\clcbpat3\cellx7693\clcbpat3\clbrdrr\brdrw60\brdrs\brdrcf3 \cellx9608 \pard\intbl\widctlpar\b 2\cell\b0\lang1033 Of a quite complex and rich table\cell\cell\cell\cell\row\trowd\trgaph70\trleft30\trbrdrl\brdrs\brdrw60 \trbrdrt\brdrs\brdrw60 \trbrdrr\brdrs\brdrw60 \trbrdrb\brdrs\brdrw60 \trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clcbpat3\clbrdrl\brdrw60\brdrs\brdrcf3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrr\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx1946\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx4111\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx5778\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx7693\clcbpat3\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrr\brdrw60\brdrs\brdrcf3\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx9608 \pard\intbl\widctlpar\b 3\cell\b0 Not printed well\cell\cell\cell\cell\row \pard\cf2\f2\fs20\lang1040\par }


  • Hi Francesco,

    TRichView and WPTools include support for using their components in RB. It's up to the 3rd party developer to provide RB support.

    The RB RichText by default relies on Delphi TRichEdit, but the architecture is open to relying on other TCustomRichEdit descendants. For example InfoPower has a TCustomRichEdit descendant. (None of the other custom RTF components adhere to this architecture, it would be more powerful if they did. For example the Delphi TDataSet architecture is followed by everyone and for that reason is one of Delphi's strengths.)

    Best regards,

    Nard Moseley
    Digital Metaphors
  • Hi Nard,

    thanks for the reply.

    So you mean that report builder could print the content of any RichEditor control that extends TCustomRichEdit.

    Since devexpress one extends TcxCustomRichEdit that extends other devexpress classes it will never support Report Builder.

    Devexpress has own printing tools i am not using.

    My vendor lockin is too big now.

    Thanks to your reply now I know the deep technical reason for this behavior I mistakenly attributed to a RB limitation.

    Have a nice week.

  • Hi.

    I return on this "in principle closed" thread since I need to find a workaround.

    My situation is not changed from when i opened this thread, anyway let's say I'd like to print the rtf content created with TcxRichEdit by Devexpress.

    Could you please suggest a solution, even if it invovles some workaround?

    One i can imagine is to
    1) open in an invisible form the TcxRichEdit and resize the form so that the RTF is visible and it is wide enough
    2) soemhow save as image the form and store the image in a temp folder
    3) in a report use TppImage.Picture.LoadFromFile

    could you please comment on this or even better suggest another solution?

    Thanks a lot.
  • Hi Francesco,

    You could try exporting the TcxRichEdit contents to a metafile and then use the RB Image to render the metafile to the printer.

    The best solution would be to use InfoPower (or WPTools, TRichView) to render the rtf content for your RB reports. You could still use TcxRichEdit in your app.

    Best regards,

    Nard Moseley
    Digital Metaphors
  • Hi Nard,

    thanks for the reply. In fact TcxRichEdit saves RTF, not some strange proprietary dxRTF so in principle InfoPower should beable to read it.

    I will consider that option so to use one of the components you named to create a bridge between TppReport and TcxRichEdit.

    Let's say I choose one component, which are the steps to move from "rtfcode retrieved in a dataset field" to "rtf printed in a TppReport"?

  • Uh, it's so easy, i did a quick tour and i tried with TRichEdit after reading some forum posts on their website.

    In the report designer 2 new toolbar buttons appear (one for non DB field and one for DB field):

    using the DBField with my dataset rtf field it works as expected.

    I need to purchase a new component but the integration really comes at no cost and i can keep TcxRichEdit for editing.

    Thanks again for the support.
Sign In or Register to comment.