Joined: 11 Sep 2015
Location: United States
Online Status: Offline
Posts: 15
Topic: Multiple Column 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?
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
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
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum