[CLOSED] HTML Report: How to put multiple text lines in heading...
I have coded this little fex to learn how to put an image in the heading of report in HTML FORMAT.
quote:
TABLE FILE MMDB1 SUM COMPUTE COLOGO/A92 = ''; NOPRINT
SUM COMMENT1 COMMENT2 COMMENT3 BY ASSIGNEE SKIP-LINE BY WO BY WDC IF RECORDLIMIT EQ 15 HEADING " Text next to the heading image " " " ON TABLE SET PAGE NOLEAD ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * GRID=OFF, SIZE=9, $ TYPE=HEADING, SIZE=20, STYLE=BOLD, COLOR=RED, $
ENDSTYLE END
I am having a problem with putting more than 1 line of text in the heading next to the image. I have searched through focal point to find an example but it seems that PDF reports are quite popular.
Does anyone have any experience doing this?
Thanks!This message has been edited. Last edited by: Kerry,
Can you edit your post and place the code in the code tags not quote tags
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 04, 2012, 05:21 PM
Tomsweb
TABLE FILE MMDB1
SUM COMPUTE COLOGO/A92 = '<img src="http://wsscapps:81/ibi_html/ib_logo.gif" border="0" />'; NOPRINT
SUM COMMENT1
COMMENT2
COMMENT3
BY ASSIGNEE SKIP-LINE
BY WO
BY WDC
IF RECORDLIMIT EQ 15
HEADING
" Text next to the heading image "
" "
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRID=OFF, SIZE=9, $
TYPE=HEADING, SIZE=20, STYLE=BOLD, COLOR=RED, $
ENDSTYLE
END
Try embedding some HTML in the first heading line.
DEFINE FILE CAR
FIRSTLINE/A1000 = '<TABLE><TR><TD><img src="http://localhost:8080/ibi_html/ib_logo.gif" border="0" /></TD>'
| '<TD>Text next to the heading image<br>Next Line</TD></TR></TABLE>' ;
END
TABLE FILE CAR
SUM SALES
DEALER_COST
RETAIL_COST
BY COUNTRY SKIP-LINE
BY CAR
BY MODEL
IF RECORDLIMIT EQ 15
HEADING
"<FIRSTLINE"
"Second Line"
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRID=OFF, SIZE=9, $
TYPE=HEADING, SIZE=10, STYLE=BOLD, COLOR=RED, $
-*TYPE=HEADING, IMAGE=http://localhost:8080/ibi_html/ib_logo.gif, $
ENDSTYLE
END
There are probably many other ways to achieve this.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 05, 2012, 04:58 AM
Tony A
As Waz states, "There are probably many other ways to achieve this." and I would be inclined to use the style inclusion of an image as is should not impact lines of heading. So, my preferred method would be this, as the code is easier to read.
TABLE FILE CAR
SUM SALES
DEALER_COST
RETAIL_COST
BY COUNTRY SKIP-LINE
BY CAR
BY MODEL
IF RECORDLIMIT EQ 15
HEADING
" <+0 First Line of Heading"
" <+0 Second Line of Heading"
" <+0 Third Line of Heading"
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRID=OFF, SIZE=9, $
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, ITEM=2, COLOR=RED, SIZE=12, $
TYPE=HEADING, IMAGE=/ibi_html/ib_logo.gif, $
ENDSTYLE
END
-RUN
However, be aware that if your image size is larger than the space taken by the number of rows in your heading, you could get overlap between report content and heading.
Also be aware that syntax such as JUSTIFY, COLPSAN and others are not supported for the image.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10