Focal Point
[SOLVED] Save Report and Graph as PDF (WF 8.0.08)

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

December 16, 2014, 12:51 PM
a415
[SOLVED] Save Report and Graph as PDF (WF 8.0.08)
Hello,

I'm trying to combine a report with a graph on a PDF in WebFocus Developer Studio 8.0.08 (Testing phase prior to upgrading). I'd like this to work so I can schedule similar reports in the future via ReportCaster.

If I make the output HTML (Report) and HTML5 (Graph), it is successful. If I make the output PDF and PDF (or even PDF and PDF_GIF), only the report displays and the graph does not. If I do PDF OPEN and PDF CLOSE (or PDF_GIF CLOSE) similar to a compound report, I get an error.

I am using the SALES file for this. I'd like this to work so I can schedule similar reports in the future via ReportCaster.

Here is my code which is PDF and PDF_GIF, which only displays the Report in the PDF output.

 TABLE FILE SALES
SUM 
     SALES.PRODUCT.UNIT_SOLD
BY  LOWEST SALES.STOR_SEG.CITY
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=REPORT,
     LINES-PER-PAGE=20,
     ALLOW-TOOLS=OFF,
$
TYPE=REPORT,
     COLUMN=N1,
     SQUEEZE=ON,
$
ENDSTYLE
END
-*IA_GRAPH_BEGIN
-*Do not delete or modify the comments below
[b]-* I REMOVED THE INTERNAL COMMENT LINES HERE BECAUSE IT WAS STRETCHING THE FORUM PAGE[/b]
-*Do not delete or modify the comments above
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='4.21875';
-DEFAULTH &WF_STYLE_WIDTH='8.020833';
GRAPH FILE SALES
-* Created by Info Assist for Graph
SUM SALES.PRODUCT.UNIT_SOLD
BY SALES.STOR_SEG.CITY
ON GRAPH PCHOLD FORMAT PDF_GIF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDataTextDisplay(true);
*END
ENDSTYLE
END
-*IA_GRAPH_FINISH
 

This message has been edited. Last edited by: a415,


8009
Windows 7
Excel/HTML/AHTML/PDF
December 16, 2014, 03:40 PM
<nick z>
Hi,
You can use PDF composer to create your procedure that will include both Reports and Graphs in PDF document.

Here is a code that would work:

-* Default Mode: ResourceLayout

*-HOLD_SOURCE
-* File report_graph_pdf
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(0.833 0.729), DIMENSION=(3.021 4.167),  ARREPORTSIZE=DIMENSION, METADATA='HEIGHT: 4.167in; POSITION: absolute; LEFT: 0.833in; Z-INDEX: 1; TOP: 0.729in; WIDTH: 3.021in', $
COMPONENT='graph1', TEXT='graph1', TOC-LEVEL=2, POSITION=(0.833 5.000), DIMENSION=(6.042 3.646), COMPONENT-TYPE=GRAPH,  ARREPORTSIZE=DIMENSION, METADATA='HEIGHT: 3.646in; POSITION: absolute; LEFT: 0.833in; Z-INDEX: 2; TOP: 5in; WIDTH: 6.042in', $
END
SET COMPONENT='report1'
-*component_type report
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.BODY.DEALER_COST
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
ENDSTYLE
END
SET COMPONENT='graph1'
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='4.21875';
-DEFAULTH &WF_STYLE_WIDTH='8.020833';
GRAPH FILE ibisamp/CAR
-* Created by Info Assist for Graph
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT PDF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-*IA_GRAPH_FINISH
COMPOUND END



Thanks.
Nick.
December 16, 2014, 04:25 PM
a415
Hi Nick,

I gave that a try and the graph does not output.

When I open composer viewer, I see both the report and the graph - the report has a preview of the data and the graph has a black square with a white X inside on the top left. If I open that graph, it opens correctly in InfoAssist and I see the graph in Live Preview. But running the entire procedure only displays the report without the graph in PDF.

--EDIT:
I just ran with Message Viewer On and the Report displayed in a PDF and the other window had this Error Message:
0 NUMBER OF RECORDS IN TABLE=       18  LINES=      50 
NUMBER OF RECORDS IN GRAPH=       18  PLOT POINTS=      5
(FOC3231) CANNOT OPEN AN HTTP CONNECTION (GRAPHSERVURL)
0 ERROR AT OR NEAR LINE     71  IN PROCEDURE RLTEMP  FOCEXEC *
(FOC3251) IMAGE FILE UNREADABLE OR INVALID: IBIIGRPH.SVG (RC=1)
0 HOLDING PDF FILE ON PC DISK ...
(FOC3296) Error found in Coordinated Compound Report: At Component graph1
Compound Report is TERMINATING.....
WebFOCUS Version 8.0.08 compiled and linked on Wed May  7 20:04:22 EDT 2014 (Gen branch8008:27) 



Thanks,
Aimee

This message has been edited. Last edited by: a415,


8009
Windows 7
Excel/HTML/AHTML/PDF
December 17, 2014, 11:05 AM
<nick z>
Hi Aimee,
That error message just means that you have security set up on your app server.
You can blank out GRAPHSERVURL fom your admin console:
Under Configuration-->Client Settings-->Graph
Blank out value for IBIF_graphservurl.
If this does not help, contact CSS, they will be able to guide you with this issue.
The reason why you are seeing the Graph in IA preview is because the preview is in HTML(or possibly in JSCHART), but never in PDF.
Thank you.
Nick.
December 17, 2014, 02:47 PM
a415
Hi Nick,

That fixed the issue! Thanks so much for your assistance!

Cheers,
Aimee


8009
Windows 7
Excel/HTML/AHTML/PDF
October 16, 2015, 11:30 AM
Doug
Thanks Nick, That just resolved an issue which I was facing intermittently.
quote:
Add SET GRAPHSERVURL = ' ';





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206