Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Report Design
Message Icon Topic: Multiple Column Post Reply Post New Topic
Author Message
Dejaneira
Newbie
Newbie


Joined: 11 Sep 2015
Location: United States
Online Status: Offline
Posts: 12
Quote Dejaneira Replybullet 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?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1545
Quote kevlray Replybullet 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.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4311
Quote lockwelle Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.012 seconds.