Focal Point
[CLOSED] Embedding HTML data in PDF format

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

March 27, 2013, 06:38 AM
Kumaravel
[CLOSED] Embedding HTML data in PDF format
Hi,

Our data consists of some HTML tags to apply some format for record, this HTML tags renders in HTML and Excel output formats. Is there any way to render these HTML tags in PDF output format?

The data consists of many html tags like
 <h1> , <br>, <table>, etc..  


Please suggest me is there any way I can use html tags in my PDF format.

I am using WebFOCUS 7.7.03 and database in Oracle.

Thanks,
Kumaravel.M

This message has been edited. Last edited by: <Kathryn Henning>,
March 27, 2013, 09:49 AM
Mighty Max
Do a search for MARKUP=ON. From what I have found it works best in the DATA report component.
Also not every html tag is supported. If this required you have to find a third party tool that will convert html to pdf.
  
TABLE FILE CAR
PRINT
   COMPUTE CNTRY/A50 = '[b]<u>' || COUNTRY || '</u>[/b]';  AS 'Country'

BY COUNTRY NOPRINT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET HTMLENCODE OFF
ON TABLE SET STYLE *
UNITS=IN,PAGESIZE='Letter',LEFTMARGIN=0.250000,RIGHTMARGIN=0.250000,TOPMARGIN=0.250000,BOTTOMMARGIN=0.250000,SQUEEZE=ON,ORIENTATION=LANDSCAPE,$
TYPE=REPORT,FONT='ARIAL',SIZE=8,COLOR='BLACK',STYLE=NORMAL,BORDER=OFF,LEFTGAP=0.05,RIGHTGAP=0.05,$
TYPE=REPORT,COLUMN=N2,WRAP=1.00,$
TYPE=DATA,COLUMN=N2,MARKUP=ON,$
ENDSTYLE
END
-RUN



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
March 27, 2013, 09:52 AM
Francis Mariani
You could try using something reserved for Compound reports, "MARKUP", but I haven't had much luck with it:

TYPE=REPORT, MARKUP=ON, ...



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 28, 2013, 04:18 AM
Kumaravel
Hi,

Thanks Mighty Max and Francis for your valuable replies. The MARKUP=ON is converting only some of basic styling HTML tags like
 <b>,<i>,<u>, etc.. 
but its not supporting all the HTML tags for eg, its not supporting
 <table>, <h1>, <br>, etc.. 
Please see the below sample code I tried.
DEFINE FILE CAR
DCAR/A50 = '<h1>'||CAR||'</h1><br><u>'||COUNTRY||'</u>';
-*DCAR/A100 = '<TABLE BORDER=1><TR><TD>'||CAR||'</TD></TR><TR><TD>'||COUNTRY||'</TD></TR></TABLE>';
END

TABLE FILE CAR
BY CAR NOPRINT
BY DCAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA,COLUMN=N2,MARKUP=ON,$
TYPE=REPORT, COLUMN=N2, WRAP=3.00, $
ENDSTYLE
END
-EXIT  


Please give your suggestion on this.

Thanks,
Kumaravel.M
March 28, 2013, 08:20 AM
Francis Mariani
Yes, it definitely does not deal with all HTML tags.

I've used SQL passthrou to strip HTML tags, but you will not get the styling that some of the tags perform. The syntax is a little confusing, but I'm removing HTML space characters and HTML tags that begin with < and end with >. This, of course does not deal with all HTML...

SQL SQLORA
select
line_num,
-*regexp_replace ( regexp_replace ( regexp_replace ( comment_text, '<p>', ' ', 1, 0, 'i' ), '<br>', ' ', 1, 0, 'i' ), '<[^>]*>', ' ' ) as comment_text
regexp_replace ( regexp_replace ( comment_text, '&|nbsp;', ' ', 1, 0, 'i' ), '<[^>]*>', ' ' ) as comment_text
-*regexp_replace ( comment_text, '<[^>]*>', ' ' ) as comment_text
from entrpt.rpt_comment
where report_cde = 'BM_PERF_DASHBRD'
and section = 'Notes'
and crnt_ind = 1
;
TABLE ON TABLE HOLD AS HCOMMENT1
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server