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

Concatenation

edited May 2003 in End User
Hello

I have some fields for example Mr. M. de Prix.

Mr. is the title field
M. is the firstname field
de is another field (Tussenvoegsel in dutch)
en Prix is the last name.

I want to place this field behind each other in a report. How can i do this
without having extra spaces etc.

Frank

Comments

  • edited May 2003
    Frank,

    You can do this by creating a string variable and adding the datafields to
    it leaving spaces in between each field. Check out demo 33, located in the
    \RBuilder\Demos\1. Reports... directory (dm0033.pas). This demo shows how
    to concatenate the city, state, and zip code of an address. Below is an
    example giving you the basic idea.

    procedure TForm1.ppVariable1Calc(TSender: TObject; Value: Variant);
    var
    lsTitle: String;
    lsFirstName: String;
    lsMiddleName: String;
    lsLastName: String;
    begin

    lsTitle := Report.DataPipeline['Title'];
    lsFirstName := Report.DataPipeline['FName'];
    lsMiddleName := Report.DataPipeline['MName'];
    lsLastName := Report.DataPipeline['LName'];

    Value := lsTitle + ' ' + lsFirstName + ' ' + lsMiddleName + ' ' +
    lsLastName

    end;

    --
    Best Regards,

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