Wednesday, May 29, 2013

Crystal Reports : Combining Text

You can actually insert data fields into text fields onto your report. This helps make text fields look "cleaner". We'll use a Starting Date and Ending Date as an example:

You'd like to have the text "From {Starting Date} to {Ending Date}" on the report header.

Step #1 : Create an empty text field and insert it onto the report.
Step #2 : Insert both the Starting Date and Ending Date fields onto the report.
Step #3 : Click into the text field and type in "From ". Make sure you type a space at the end.
Step #4 : Now drag the Starting Date field directly onto the text field. You should see a text cursor appear (a vertical line) within the text field. This is where the data field will be placed.
Step #5 : Click into the text field again and type " to ". Again, make sure to provide a beginning space and ending space.
Step #6 : Now drag the Ending Date field directly onto the text field. Position it using your text curaor as a guide.
Step #7 : Resize the text field to assure that the whole string can be displayed properly.

The result : Your text field will now read "From 12/01/2008 to 12/31/2008". Combining text and data this way assures the spacing between "From" and "to" is always accurate.

No comments: