Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Wanting to use TdxRichEditControl with Reportbuilder

edited January 2017 in General
Hi,

I am having problems with Richedit showing correctly in reportbuilder. I
believe this is because Reportbuilder is using a wrapper for Delphi's
native TRichEdit component which is based on the old Riched20.DLL
component, whereas DevEx (amongst other developers) are using a wrapper
based on the newer RichEd32.dll component.

I see that Reportbuilder makes allowances to be able to use both
InfoPower, WPTools and TRichView.

I'm wanting to use DevEx components instead for rendering.

I have attempted to write a new unit based on the ppWWRichEd.pas unit,
however I'm hitting a problem because ppWWRichEd.pas is expecting the
richedit component to be a descendant of TCustomRichEdit but DevEx's
component doesn't descend from there...

I was wondering if there is a way to be able to use DevEx's components
with Reportbuilder, and how I would go about writing a unit to suit?

I can see that one option might be to render the RTF as a metadata image
and use that - however I'm wanting to be able to use stretch to have the
report print dynamically depending on how much text has been entered by
the user.

Thanks & Regards

Adam.

Comments

  • edited January 2017
    Hi Adam,

    1. The RB RichText is a wrapper for the Delphi RichEdit. InfoPower
    implements a RichEdit descendant class, wwRichEdit, that can be registered
    with RB as a replacement RichEdit. The dxRichEdit does not descend from
    TRichEdit and therefore this approach is not valid.

    TppRichText = class(TppStretchable)
    - wrapper for TCustomRIchEdit (TRichEdit, TwwRichEdit)


    2. The authors of TRichView and WPTools developed RB wrapper components to
    enable their components to be used with RB.

    WPToolsWrapper = class(TppStretchable)
    TRichViewWrapper = class(TppStretchable)


    3. A stretchable dxRichText wrapper must descend from TppStretchable like
    number 2 above and as such this is much bigger task. You might want to
    request the DevEx developed an RB add-on like their competitors did. For an
    example check the source code to TppRichText (ppRichTx.pas).

    dxRichText = class(TppStretchable)
    - wrapper for dxRichEdt

    The CalcSpaceUsed method is called by the report engine. You need implement
    that method to calculate how much text will fit into the available page
    space (a rectangluar area). If the text fits, then how much page space does
    it require (minimum). If the text will not fit, then calculate what range of
    text will fit and facilitate an overflow.

    Does the dxRichEdit provide methods to perform those types of operations?

    For the actually rendering, the RB RichText renders the rtf data as a
    metafile.










    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.