Click here to Skip to main content
12,399,362 members (58,395 online)
Rate this:
Please Sign up or sign in to vote.
See more: CrystalReports
Hi Friends,,,,

How to use newline or next line in crystal report. We used '\n' in c++ but in Crystal report i don't know...

I have address fields in my rpt file i.e., Add1,Add2 and Add3. I am concatenating Add1,Add2 and Add3. But Add2 and Add3 should come in nextline.

Can anybody?
Posted 7-Nov-12 19:40pm
Updated 7-Nov-12 19:43pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use ChrW(13) for new line

for example...
{stored.Add1} + ChrW(13) + {Stored.Add2} + ChrW(13) + {Stored.Add3}
Happy Coding!
Smile | :)
Member 9501115 8-Nov-12 2:01am
Chrw() is not working in Crystal report 8.5. There is know function called Chrw() but i observed Chr()
Aarti Meswania 8-Nov-12 2:03am
have you tried Chr(10) ?
Member 9501115 8-Nov-12 2:34am
yes i tried..but not working
Member 9501115 8-Nov-12 2:45am
Hey..Sorry....Itz working..Chr(10). Actually i haven't used "Can Grow" Property.
Now itz working fine..

Thank You.....
Aarti Meswania 8-Nov-12 2:52am
Welcome :)
Glad to help you!
Saurav Jaiswal 2-Jul-13 10:04am
Thank You. This works perfectly.
Chr(10) and 'Can Grow' property as true .
Aarti Meswania 3-Jul-13 3:05am
Glad to help you! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try to get HTML string from the formula and use html tag to format your output, like

"Address: " & ToText(Add1) & " <br> " & ToText(Add2)

drop the formula field on your report and change its 'Text Interpretation' property on 'Paragraph' tab to 'HTML Text'
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

I've got a variation on the new line question

I have one field and I want to insert a carriage return in the middle of the value based on a the appearance of a certain word.

For example, the text field value might be "Credit line for the object. Company Name." (all in one field)
I want to insert a new paragraph line so it displays as;

Credit line of the object.
Company Name.

Is this possible?
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

Hello Member
I give you very easy way for this:

If you want to add address in crystal report as a Add1, Add2, Add3.
You can take a three Text object as a txtAdd1, txtAdd2, txtAdd3.

you can manage this for your requirement. It's a very easy compare of formula. If you use formula it's so difficult to modify it's such as bold text, underline, alignment etc.

if you fill your address in differences three text object you can work easy ant its easy to mentaine if future uses.

After that desion wise you.
You can try different way and you desided which is easy to use.

Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100