Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: How to print new line when a comma ( , ) occured Post Reply Post New Topic
Author Message
sajhak
Newbie
Newbie
Avatar

Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
Quote sajhak Replybullet Topic: How to print new line when a comma ( , ) occured
    Posted: 06 Oct 2009 at 1:48pm
Hi all,

Im quite new to Crystal Reports and these days im working on a project with VB 6.0 and Crystal Report 9.

My question is, i need to display an address column, there i need to display a new line for every occurrence of comma (,) ..
for example, in the database the address will be saved as "No 23, Temple road, Galle, Sri Lanka" and think that is saved in one column as a single String. When i display in the report that should be displayed as follows

No 23,
Temple road,
Galle,
Sri Lanka

that is , for each occurrence of the comma, it will start to print the others from a new line..

Can anybody tell me how to achive that ? in which behavoir i have to set in the reports field ??

Thanks a lot in advance
Sajith
                  

Edited by sajhak - 06 Oct 2009 at 1:53pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 06 Oct 2009 at 2:00pm
I would try Replace({table.addressfield},",",chr(13)+chr(10))
IP IP Logged
sajhak
Newbie
Newbie
Avatar

Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
Quote sajhak Replybullet Posted: 06 Oct 2009 at 2:17pm
Thanks for the quick reply lockwelle,

Could i know where do i have to write the code that you have mentioned .. do i need to add as an expression in Crystal Report ? if so how can i achieve that ?

Or, do we need to add that "Replace" code into our VB code ? even if that s, how can i achieve that also ??

Thanks a lot .
Sajith
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 06 Oct 2009 at 3:05pm
you can create a formula in CR.  then place the formula on the report where you want it to display.  I would set the Can Grow on, but it isn't necessary if you know the max lines that will be displayed for an address.
IP IP Logged
sajhak
Newbie
Newbie
Avatar

Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
Quote sajhak Replybullet Posted: 07 Oct 2009 at 12:11am
Thanks lockwell,

 i will try that .. i asked such a simple question cos im new to those Crystal report area ..


IP IP Logged
sajhak
Newbie
Newbie
Avatar

Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
Quote sajhak Replybullet Posted: 10 Oct 2009 at 11:58am
Quick question lockwell,

what do you meant by chr(13)and chr(10) ?? wht does it says ? is that the syntax ?

Regards
sajhak
IP IP Logged
sajhak
Newbie
Newbie
Avatar

Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
Quote sajhak Replybullet Posted: 10 Oct 2009 at 12:14pm
I got that ... thanks .. and it worked as i wanted .. thanks again ..
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.016 seconds.