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

BDEdits blank problem

edited November 2004 in General
I have an invoice report that has Mr FirstName Surname

I need to move the firstname left if there is no Mr
or the Surname to the left if no Firstname.

Comments

  • edited November 2004
    Hi Steve,

    Instead of using three TppDBText components, try using one TppVariable and
    in its OnCalc event, set its value by doing something similar to the
    following...

    var
    lsPrefix: String;
    lsFirstName: String;
    lsSurname: String;
    begin

    lsPrefix := Report.DataPipeline['Prefix'];
    lsFirstName := Report.DataPipeline['FirstName'];
    lsSurname := Report.DataPipeline['Surname'];

    if lsPrefix <> '' then
    lsPrefix := lsPrefix + ' ';

    if lsFirstName <> '' then
    lsFirstName := lsFirstName + ' ';

    Value := lsPrefix + lsFirstName + lsSurname;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004

    Thanks Nico that did the job. I now need to do the same with 5 address
    DBEdit fields that are located above each other. I presume I need to use the
    same format but how do I put a carrage return at the end of an address line.

    eg Value := lsAdd1+ (carrage return) + lsAdd2 + (carrage return)+
    lsPostcode;




  • edited November 2004
    Hi Steve,

    If you are looking to do the same thing with a multiple line address, check
    out demo 33 located in the \RBuilder\Demos\1. Reports\... directory
    (dm0033.pas). This shows how to more or less do the same thing using a
    TppMemo so multiple lines can be shown. Hope this helps.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.