Announcements
 Crystal Reports Forum : General Information : Announcements
Message Icon Topic: MutliLine Formula Post Reply Post New Topic
Author Message
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Topic: MutliLine Formula
    Posted: 14 Dec 2007 at 10:33pm
Hi I am having 4 fields  for address. Add1, Add2, Add3, Add4.
 
I want to create a formula  in such a way that the text  formula should  have the value of above fields in  four lines. I will check if the field is not empty. If the field is empty then i will not add it to the formula.
 
Please tell wheter its  possible to write a multiline text in a formula.
 
Can u please send me your book, i want to become a expertise in Crystal Reports.
 
Thanks
Wating for a reply Smile


Edited by Savan - 14 Dec 2007 at 11:20pm
Thanks
Savan
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 17 Dec 2007 at 4:17am
I think the key to your solution is introducing a carriage return.  The cleanest way to do so, IMHO, is using ChrW(13).  (13 being the ASCII code for carriage return, and ChrW() being a function that returns the character for a given ASCII code)

So your formula might look like:


Local StringVar AddOut;

AddOut = {MyReport.Add1} & ChrW(13);
AddOut = AddOut & {MyReport.Add2} & ChrW(13);
IF IsNull({MyReport.Add3} = False THEN
     AddOut = AddOut & {MyReport.Add3} & ChrW(13);
AddOut = AddOut & {MyReport.Add4};

AddOut




IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 17 Dec 2007 at 4:59am
Thanks Lugh ! Your solution works absoulety fine. 
Thanks
Savan
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.