we use "vbnewline" in our vb to put one line in text.
how to put it in crystal report through coding ?
Printable View
we use "vbnewline" in our vb to put one line in text.
how to put it in crystal report through coding ?
Try Chr(13) or some use Chr(13) + Chr(10)
sorry but it does not work.
Yeah, that is helpful. Maybe if you explained your problem a little better.Quote:
sorry but it does not work.
Chr(13) does work but you need to set the Can Grow option of the reporting object. For example
{Customers.CompanyName} + chr(13) + {Customers.ContactTitle}
Should've seen that myself brucevde. I have my defaults to Grow 0 automatically so I forgot about that one.
i set property cangrow as true but still not working it gives space instead of new line.
Do you want an actual line drawn on the page or do you wish to have more space available to show the text as two lines? I've never tried setting the property cangrow from code but in Crystal, it requires a numeric parameter not boolean since you can specify how many lines it will max out.
i dont want to draw line.I want my text as in 2/3 lines it depends upon database structure.
For example i want to display address of customer i hv stored address in different fields in my db.
so i want to place it in this way, addr1 + newline + addr2 + addr3 + city + country
try using
Code:addr1 & chr(10) & chr(13) & addr2 & chr(10) & chr(13) & addr3 & chr(10) & chr(13) & city & chr(10) & chr(13) & country
sorry but not working.
li'll suggestion, try the above methods in a new report (not the existing ones) and post the results. Also use a Formula Field and not the actual Fields.
Good luck :thumb:
Hi,
I realise that this is a very old thread but I've had a very similar problem and wanted to add my solution since one hasn't been provided yet -
If you have "Text Interpretation" set to HTML for the object as I did you must use the "<br>" to add carriage returns.
For Crystal XI -
On the report; right click the object - Format Field - Paragraph tab - Text Interpretation frame at the bottom
There is no Text Interpretation for text boxes, drag a function onto your report and size it accordingly.
Please note that there appears to be a bug if you try to add multiple breaks, the workaround is to add a white space between your breaks -
Code:' I'm using basic syntax
Dim sOut As String
sOut=sOut & "The quick brown fox<br>"
sOut=sOut & " <br>" ' The space is important as the break is ignored otherwise!
sOut=sOut & "jumped over the lazy dog."
Formula=sOut