Print Page | Close Window

Multiple Column

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=22911
Printed Date: 04 May 2024 at 9:04am


Topic: Multiple Column
Posted By: Dejaneira
Subject: Multiple Column
Date Posted: 03 Nov 2020 at 5:18am
Is there a way to format a large body of text to print in multiple columns similar to Word where the text wraps? I tried formatting the details section with multiple Columns and setting the width on the layout tab but it just repeats the same information in both columns. I need it to print the page of text into two columns? I have 8 pages of legal verbiage that needs to be printed in this fashion. When I tried breaking the text our into separate columns of text boxes the formatting goes all wonky on me. Any recommendations?



Replies:
Posted By: kevlray
Date Posted: 03 Nov 2020 at 6:25am
You might be able to adjust the page size to 'trick' Crystal Reports into columns.  I have not tried it myself.


Posted By: lockwelle
Date Posted: 04 Nov 2020 at 6:10am
Formatting text is really tricky in Crystal. If the font is not proportional, it will be easier as you can give a max count on the number of characters that will fit in a column. You will need to think about looking for the last space that is before this limit to keep whole words together.

I think that you could use 1 formula to drive your 2 text boxes. For each new detail line (long text) I would reset the variable to 0. The formula itself would parse the string to be displayed and update the variable to where it is in the text.

I am think that this will work, because I think that Crystal processes report objects from left to right and top to bottom...I could be wrong in this.

Some sample code:
In the group header or a 'dummy' detail section above the detail to be displayed I would put a formula like:
shared numbervar lastchar := 1;
"" //list will effective hide the value of the formula from display

in the detail section there would be 2 instances of this formula:
shared numbervar lastChar;
local numbervar lastSpace;
local stringvar displayMe := substring({table.field}, lastChar, lastChar + 1000);//just made up the 1000 as limit to be displayed
lastSpace := instrrev(displayMe, " "); // find the last space
displayMe := LEFT(displayMe, lastSpace - 1);
lastChar := lastChar + lastSpace; //update the counter
displayMe   //show the text


At least that would be my first attempt.

HTH
d



Print Page | Close Window