Print Page | Close Window

how to change a new line?

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11241
Printed Date: 21 Apr 2025 at 10:16am


Topic: how to change a new line?
Posted By: crystaliao
Subject: how to change a new line?
Date Posted: 27 Sep 2010 at 10:23pm
in my raw data, they're 5 line's

ex:
Q1.how old are you?
A1.under 20
A2.21-30
A3.31-40
A4.above 40

but the output in text object are all in the same line like
Q1.how old are you?A1.under 20A2.21-30A3.31-40A4.above 40

it's abuse to use '/n', what are other ways to separate them?

thanks~



Replies:
Posted By: jkwrpc
Date Posted: 05 Oct 2010 at 9:44am
Make sure your text objects has enoughs lines in it, in this case five. The place each data field on a a separate line. If the five lines are all in one data field string you will have to manipulate the string to split it or to insert the carriage return/ new line.
 
It is is hard to give a really clear answer without a better understanding of the raw data, one field or five.
 
Hope this helps
 
John W.
www.CustomReportWriters.net


Posted By: crystaliao
Date Posted: 10 Oct 2010 at 9:56pm
hi John,

I already make sure the text objects is enoughs for lines I want.

about the raw data...I copy the raw date from Excel which has five lines like this:
Q1.how old are you?
A1.under 20
A2.21-30
A3.31-40
A4.above 40

then past it in SQL Server database, but it's only shows five lines into one line like this:
Q1.how old are you? A1.under 20 A2.21-30 A3.31-40 A4.above 40

I've try to insert char(10),char(13), but it not work.


Posted By: jkwrpc
Date Posted: 11 Oct 2010 at 5:47am
Is it a single data field you are trying to break into 5 lines or 5 separate data fields on 5 lines?


Posted By: crystaliao
Date Posted: 11 Oct 2010 at 7:16am
it is a single data field I'm trying to break into 5 lines.


Posted By: jkwrpc
Date Posted: 11 Oct 2010 at 8:22am

Okay, try this, create a formula, in the formula create a string variable. Pass the results of the data field to the string variable and then use the string functions to break your string at the appropriate point and inserting your carriage return, new line code.

You can then load the formula into a text box of the appropriate size and then format your text box.
 
If you look in the Crystal Help file you will see the String functions available to you all of which should get you the result you want.
 
Hope this helps
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net .
 



Print Page | Close Window