Focal Point
How to indent rows in a report and have lines wrap?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7331023232

June 13, 2007, 09:42 AM
DonF
How to indent rows in a report and have lines wrap?
I need to create a report that looks like an outline that contains 3 levels of indent. Each level must wrap at its own level of indent. Each line of text can be up to 500 characters long. So the report would look like indented paragraphs something like you would see in a MS WORD document.

Users type in text into a SQL Server data file which is defined in the FOCUS MFD as A500V. Each row in the data has a flag which indicates what level of indent the row should havein the report. There can be up to 10 rows of data, each with its own individual indent flag (ranges from 0 to 2).

My code is similar to this:

DEFINE FILE OUTLINE
ARROW2/A507= IF BULLET_FLAG EQ '2' THEN ' > ' | ENTRY_TEXT ELSE ENTRY_TEXT;
ARROW1/A1= IF BULLET_FLAG EQ '1' THEN '>' ELSE '';
END

TABLE FILE OUTLINE
PRINT
ARROW1 AS ''
ARROW2 AS ''
BY LINE NOPRINT
BY BULLET_FLAG NOPRINT
ON TABLE SET STYLE *
TYPE=REPORT,COLUMN=ARROW2,WRAP=4, $
ENDSTYLE
END

This works fine if no lines wrap. If a row where BULLET_FLAG EQ '2' is longer than 4 inches, it wraps, which is expected. However, it wraps too far to the left; all the way to the left side of the data column.

Does anyone know how to indent a row of data and have it wrap at the indent level? Maybe CSS is the way to go.

I wonder if there is a way to dynamically build the report using HEADING?

I also cannot convert the field to a TX field since that is not supported in a DEFINE.

Don
June 13, 2007, 10:39 AM
Alan B
I would tend to use the CSS route. Try this as a starting point:
SPAN/A50 = IF INDENT_FLAG EQ 2 THEN '<span style="margin-left:4em;">' 
           ELSE
           IF INDENT_FLAG EQ 1 THEN '<span style="margin-left:2em;">' ELSE '<span>';
textField/A550V = SPAN | ENTRY_TEXT | '</span>';



Alan.
WF 7.705/8.007
June 13, 2007, 11:01 AM
DonF
Alan...thanks for the reply.

I tried it in HTML. the indent worked, but the wrapping didn't work. The span tag made the correct indent, but it wraped too far to the left. It went all the way to the left margin. This illustrates the problem I'm describing. I need the wrapped text to line up with the indent.

Also, this is a PDF report and the span won't work there. Eventually we will do this in PPT output as well.

Any other ideas?

DonF
June 13, 2007, 11:22 AM
Alan B
Span isn't right for HTML wrap, if I think about it, as it's an in-line element. div or p are block elements.

For other outputs, PDF, you can't as you say use CSS. So the only other option I can think of is to use the PARAG function to mark a width.

Then use STRREP to change the 'mark' to a CR and some spaces. The greater the indent the more spaces.

I did something similarish, not the same, but I think it could be worked on in this topic.


Alan.
WF 7.705/8.007
June 25, 2007, 12:26 PM
Kerry
Hi DonF,

Has this issue been resolved on your side? Have you got a chance to try Alan's suggestions?

Many thanks for Alan's input. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.