Author |
Message |
sajhak
Newbie
Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
|
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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 06 Oct 2009 at 2:00pm |
I would try Replace({table.addressfield},",",chr(13)+chr(10))
|
IP Logged |
|
sajhak
Newbie
Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
|
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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
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 Logged |
|
sajhak
Newbie
Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
|
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 Logged |
|
sajhak
Newbie
Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
|
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 Logged |
|
sajhak
Newbie
Joined: 06 Oct 2009
Location: Sri Lanka
Online Status: Offline
Posts: 12
|
Posted: 10 Oct 2009 at 12:14pm |
I got that ... thanks .. and it worked as i wanted .. thanks again ..
|
IP Logged |
|
|