Focal Point
Wrapping a field in a heading - Difference in PDF and HTML

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

July 01, 2009, 12:25 PM
jfr99
Wrapping a field in a heading - Difference in PDF and HTML
Hi All,

I have a question about the following focexec using the CAR file:

-*************************************************************************
-SET &TEXT = 'This is my long piece of text that needs to be wrapped.';
-*
DEFINE FILE CAR
MyText/A100 = '&TEXT' ;
END
-*
-*-GOTO PRT_HTML
-*
TABLE FILE CAR
HEADING
"MyText: <MyText "
PRINT COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, ITEM=1, OBJECT=FIELD, WRAP=1, $
ENDSTYLE
END
-EXIT
-*
-PRT_HTML
DEFINE FILE CAR
MyText/A100 = '&TEXT' ;
END
-*
TABLE FILE CAR
HEADING
"MyText: <MyText "
PRINT COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, ITEM=1, OBJECT=FIELD, WRAP=1, $
ENDSTYLE
END
-*************************************************************************

Run this asis (PDF version) and then un-comment the "-*-GOTO PRT_HTML" line and run again (HTML version).

In the PDF version, the "MyText:" label appears on the first line or top part of the wrapped text(this is what I want).
In the HTML version, the "MyText:" label appears on the last line or bottom part of the wrapped text.

How do I get the "MyText:" label to appear on the first line(top part) of the wrapped text in HTML?

Please advise.

Thanks
Jim


WebFocus 8.201M, Windows, App Studio
July 01, 2009, 12:59 PM
Mighty Max
Try
  
-PRT_HTML
DEFINE FILE CAR
MyText/A100 = '&TEXT' ;
END
-*
TABLE FILE CAR
HEADING
"MyText: <MyText"
PRINT COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, ITEM=2, WRAP=1, $
ENDSTYLE
END

This message has been edited. Last edited by: Mighty Max,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
July 01, 2009, 01:25 PM
mgrackin
Interesting behavior. If you look at the source for the resulting HTML page you sill see that the long text is encapsulated in a SPAN object when you leave out the HEADALIGN setting. The CSS in the source does indicate 'vertical-align:top' but it does not seem to move the 'MyText:' to the top of the cell when the SPAN is also in the same cell. HEADALIGN forces that HEADING items into seperate cells, hence causing the 'MyText' to shift to the top of the cell.

Jim, I wrote a couple of articles on HTML vs PDF output formats you might find useful. Go to the following link and look for WebFOCUS HTML and PDF Report Design near the bottom. There are two parts.

Tips and Techniques Articles


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
July 01, 2009, 02:13 PM
jfr99
Thanks Mighty Max and Mickey.

Mighty Max,

I made your change and that fixed the problem, although in my real fex, I had been using HEADALIGHN=NONE so now I have other issues.

Mickey,

I've read both parts of your article. They have been very helpful. Thanks

I'm currently working on a project where I need to create (in HTML) freeform text/fields that will be displayed in portal pages. I'm doing this by putting all the text and data fields in one big heading and trying to controll the formatting and look by stylesheet parameters. I'm hand coding this(don't use the GUI). If anyone has any examples of this or any advise, I would appreciate your comments.

One question, is there a way of setting the window/page size for the report, so the report will scroll side-to-side instead of wrapping?

Thanks
Jim


WebFocus 8.201M, Windows, App Studio