Click here to Skip to main content
15,883,772 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 7-Nov-12 19:43pm
v2

Use ChrW(13) for new line

for example...
{stored.Add1} + ChrW(13) + {Stored.Add2} + ChrW(13) + {Stored.Add3}

Happy Coding!
:)
 
Share this answer
 
Comments
PRAKASH_N 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) ?
PRAKASH_N 8-Nov-12 2:34am    
yes i tried..but not working
PRAKASH_N 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!
Try to get HTML string from the formula and use html tag to format your output, like

SQL
"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'
 
Share this answer
 
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?
Thanks
 
Share this answer
 
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.

:)
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900