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

How to add a carrage return

edited February 2005 in General
procedure TDatamodule4.ppVariable12Calc(Sender: TObject;
var Value: Variant);
var
lsPrefix,lsFirstName,lsSurname,lsCompany,lsadd1,lsadd2,lsadd3,lstown,lspost
: String;
begin


lsCompany := ppDBPipeline_Customer_Table['Company_Name'];
lsadd1 := ppDBPipeline_Customer_Table['Address1'];
lsadd2 := ppDBPipeline_Customer_Table['Address2'];
lsadd3 := ppDBPipeline_Customer_Table['Address3'];
lstown := ppDBPipeline_Customer_Table['Town'];
lspost := ppDBPipeline_Customer_Table['Post_Code'];

if lsCompany <> '' then lsCompany := lsCompany+#13#10;
if lsadd1 <> '' then lsadd1 := lsadd1+' ';
if lsadd2 <> '' then lsadd2 := lsadd2+' ';

value := lsCompany + lsadd1 + lsadd2;


end;

I get the result 'Testcompany 2 reeds rd leeds'

I need the result

Testcompany
2 reeds rd
leeds

ie a carrage return added to the end of field.

Cheers

Comments

  • edited February 2005
    Hi Steve,

    Unfortunately unstretchable objects such as the TppVariable and TppLabel
    will not accept the line feed or carrage return characters. I would suggest
    using a TppMemo in place of the variable and testing with that.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2005


    What is the equivalent of :
    value in TppMemo
    on calc in TppMemo

    Cheers.


  • edited February 2005
    Hi Steve,

    You may need to play around with it a bit but try using the Band.BeforePrint
    event to set the TppMemo.Text property. If this does not give you the
    correct output in some cases, I would recommend using that same
    TppVariable's OnCalc event to set the Text property of the memo, then simply
    set the variable's visible property to False.

    --
    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.