we use "vbnewline" in our vb to put one line in text.
how to put it in crystal report through coding ?
we use "vbnewline" in our vb to put one line in text.
how to put it in crystal report through coding ?
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST
Try Chr(13) or some use Chr(13) + Chr(10)
sorry but it does not work.
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST
Yeah, that is helpful. Maybe if you explained your problem a little better.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.
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST
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
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST
try using
Code:addr1 & chr(10) & chr(13) & addr2 & chr(10) & chr(13) & addr3 & chr(10) & chr(13) & city & chr(10) & chr(13) & country
THANK YOU FOR RECOGNIZING MY CONTRIBUTION AND RATING ME!![]()
Working Environment
Version: VB6
OS: ME/XP
Office Applications: FAQs By RobDog888 * Great Excel tutorial by si_the_geek * VB6 Errors by Si * VB6 Controls: MSFlexgrid populate by si * RichText Box Tips & Tricks * Crystal Report: Multi column Report CR9 & 11 * CR9 & 11 Group Totals * ADO related: ADO further steps * ADO Tutorial by Dee-u * DB related: SQL Reserved Words * More Reserved Words * Diff ways to Insert Records into a DB * Pictures in Database * VB6 Controls: MSFlexgrid populate by si * RichText Box Tips & Tricks * Crystal Report: Multi column Report CR9 & 11 * CR9 & 11 Group Totals * ADO related: ADO further steps * ADO Tutorial by Dee-u * DB related: SQL Reserved Words * More Reserved Words * Diff ways to Insert Records into a DB * Pictures in Database
sorry but not working.
WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST
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![]()
THANK YOU FOR RECOGNIZING MY CONTRIBUTION AND RATING ME!![]()
Working Environment
Version: VB6
OS: ME/XP
Office Applications: FAQs By RobDog888 * Great Excel tutorial by si_the_geek * VB6 Errors by Si * VB6 Controls: MSFlexgrid populate by si * RichText Box Tips & Tricks * Crystal Report: Multi column Report CR9 & 11 * CR9 & 11 Group Totals * ADO related: ADO further steps * ADO Tutorial by Dee-u * DB related: SQL Reserved Words * More Reserved Words * Diff ways to Insert Records into a DB * Pictures in Database * VB6 Controls: MSFlexgrid populate by si * RichText Box Tips & Tricks * Crystal Report: Multi column Report CR9 & 11 * CR9 & 11 Group Totals * ADO related: ADO further steps * ADO Tutorial by Dee-u * DB related: SQL Reserved Words * More Reserved Words * Diff ways to Insert Records into a DB * Pictures in Database
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