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

RTF Align Field MailMerge

edited September 2010 in General
Hello,

is it possible to set the alignment and width of an MailMerge Field Field.

I have to align a field on the right in RTF.

Thx

Greetz,

Désirée Willemsen

Comments

  • edited September 2010
    Hi Désirée,

    There is nothing built into the MailMerge syntax that will automatically
    align the text for you however all MailMerge does is replace the markup
    command with the text received from the dataset. If you right align the
    command "Field" , the result should be right aligned.

    There is also no way to automatically control the width of the field value
    from within the markup language. One option is to control the field width
    from the DataPipeline. Another would be to use the OnMailMerge event of the
    TppRichText component to manually edit the RichText text after it has been
    merged.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2010
    Hi Nick,

    thx for answering.

    The problem is as follows:

    SomeText : ? 1.233,00
    OtherText : ? 245,00

    Above is what i'm looking for.

    In your suggestions all of the text is right aligned, i only want to align
    te currency right aligned.

    The font i'm using isn't fixed. Do you have any other suggestions?

    Thx



  • edited September 2010
    Hi Désirée,

    Unfortunately I think this is a limitation of RichText itself. If you open
    an RTF editor such as Wordpad or MS Word, you will find that it is not
    possible to right align a section of a line of text without creating a table
    or column inside the RTF document. Tables and columns are not supported by
    the native RichText component in ReportBuilder.

    One option would be to enhance the built-in RTF control by using Infopower
    (which I believe supports tables). The RTF's would need to be created
    elsewhere then loaded into the report. See the following article.

    http://www.digital-metaphors.com/rbWiki/RCL/RichText/RB_RichText

    Another option would be to separate the RichText text from the field values.
    You could have a single RichText component with numerous DBText objects next
    to it that are right aligned.

    RichText Text: | DBText1
    RichText Text: | DBText2
    RichText Text: | DBText3

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2010
    Hi,

    i've solved the problem, i changed the code of ppRichTxDrwCmd.pas now it
    uses msftedit.DLL instead of RICHED20.DLL, it supports now Tables with
    alignment.

    Thx for your advice.

    Desiree
This discussion has been closed.