Link to home
Start Free TrialLog in
Avatar of cookiejar
cookiejarFlag for United States of America

asked on

Fake sub paragraph indentation in Crystal Reports Xl

In Crystal reports, I have applied a formula to indent text if the display level exceeds 1.  If  the text exceeds the allocate space on the report it wraps around which is what I want it do.  However I want  the text that wrapped to the next line to align with the text above it.  See the attached example.
Indentation.doc
Avatar of James0628
James0628

I don't have CR XI, but I'm thinking that someone once mentioned here that one of the later CR versions (CR XI or maybe CR 2008) included some kind of indenting options in the field format.  You might start by looking for that.  I'm sorry, but I can't remember the details.

 Otherwise, one option is to manually break the field into separate lines, so that you can add spaces where you want to.

 But if you actually just want to indent the whole field based on another field, you may be able to just put a second copy of that field on the report, but moved a bit to the right, and suppress that field unless your "indent" condition is true.

 In the simplest case, let's say that that was the only field in your detail section.  You'd create a new detail section and put that field in it, but slightly to the right.  Then go into the section expert for the original detail section (right-click to the left of the detail section and select "Section Expert"), click the formula (X+2) button to the right of "suppress" and enter the following:

{DISPLAY_LEVEL} > 1


 Then go to the section expert for the new section and enter the following suppression formula:

{DISPLAY_LEVEL} <= 1

 You're specifying when the sections will be suppressed (not show), so the original section will show when the level is <= 1, and the second section will show when the level is > 1.

 How well that will work for you will depend on your report.

 James
There is an indenting option on the field format for CR XI but no way to control it through a formula.

You could possibly use the SIZE AND POSITION which has a formula for the X location but I think that will just move the field right and not shrink the width.

How many indents are you looking at?

mlmcc
Avatar of cookiejar

ASKER

mlmcc:

I can have as many as  20 indentations.   If the Display_Level is > 1, the field should be indented at each incremental level.
I used the following formula for the X location to position the column but it doesn't move
If display_level  > 1 then
  .250 * {BE.Display_Level}
else
  .250

What am I doing wrong?
The solution that GRIPA1 posted was the solution to my problem.  Thank you, GRIPA1 .
Where is that comment?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm pretty sure that's the "indentation option" I was thinking of.  Glad it worked for you too.  The duplication thing wouldn't have been much fun with 20 different levels.  :-)

 James