As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
The legend text does not display when I HOLD a graph, it does display when I PCHOLD a graph. I need to HOLD the graph as an image to add to a PDF report. Is there a graph java style attribute that controls this?
This message has been edited. Last edited by: Francis Mariani,
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
Hi Francis, This works, maybe you can find the code that is missing from yours...
-* File 1_excel_graph.fex
APP PREPENDPATH IBISAMP
-RUN
-SET &ECHO=ALL;
-**************************************
-* CHANGE TO YOUR SERVER IP ADDRESS *
-**************************************
-SET &SERVER = '150.108.28.XXX:8080';
-SET &PDF_URL = &SERVER || &FOCEXURL;
-SET &FMT = 'PDF';
-SET &APPFOLDER = 'baseapp/';
-SET &USERID = GETUSER('A8');
-SET &LC_USER = LOCASE(8, &USERID, 'A8');
-SET &GIF_FILE1 = &LC_USER || 'graph1' || '.jpg' ;
-SET &PATH = &APPFOLDER || &GIF_FILE1;
APP FI GRAPH2 DISK &PATH
-RUN
GRAPH FILE CAR
SUM
RETAIL_COST AS ''
ACROSS COUNTRY
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 205
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH HOLD AS GRAPH2 FORMAT JPEG
ON GRAPH SET STYLE *
TYPE = REPORT, FONT=VERDANA, SIZE=9, $
TYPE = HEADING, FONT=VERDANA, SIZE=10, STYLE=BOLD, $
ENDSTYLE
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setFontName(getDataText(),"Verdana");
setDepthAngle(65);
setPieDepth(45);
restoreAllSlices();
setPieFeelerTextDisplay(2);
setPieTilt(25);
setPieLabelDisplay(0);
setDisplay(getPieLabel(),true);
setLegendAutomatic(false);
setFontStyle(getLegendText(),2);
setFontStyle(getPieSliceLabel(),2);
setTextFormatPreset(getPieSliceLabel(),5);
setFontSizeInPoints(getTitle(),12);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setTextFormatPattern(getDataText(),"$#,###,###,###.##");
setFontSizeInPoints(getO1Label(),9);
setFontSizeInPoints(getY1Label(),9);
setFontSize(getDataText(),10);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),12);
setLegendMarkerPosition(0);
setTransparentBorderColor(getChartBackground(),true);
setRect(getPieFrame(), new Rectangle(-15500,-13500,27000,27000));
setRect(getFrame(), new Rectangle(-10400,-10000,25000,30000));
setTextString(getTitle(),"TOTAL RETAIL COST BY COUNTRY");
ENDSTYLE
END
-RUN
-SET &GIF_FILE2 = &LC_USER || 'graph2' || '.jpg' ;
-SET &PATH = &APPFOLDER || &GIF_FILE2;
APP FI GRAPH2 DISK &PATH
-RUN
GRAPH FILE CAR
SUM
COMPUTE PROFIT/P13.2M = RETAIL_COST-DEALER_COST; AS ' '
ACROSS COUNTRY
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 205
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH HOLD AS GRAPH2 FORMAT JPEG
ON GRAPH SET STYLE *
TYPE = REPORT, FONT=VERDANA, SIZE=9, $
TYPE = HEADING, FONT=VERDANA, SIZE=10, STYLE=BOLD, $
ENDSTYLE
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setFontName(getDataText(),"Verdana");
setDepthAngle(65);
setPieDepth(45);
restoreAllSlices();
setPieFeelerTextDisplay(2);
setPieTilt(25);
setPieLabelDisplay(0);
setDisplay(getPieLabel(),true);
setLegendAutomatic(false);
setFontStyle(getLegendText(),2);
setFontStyle(getPieSliceLabel(),2);
setTextFormatPreset(getPieSliceLabel(),5);
setFontSizeInPoints(getTitle(),12);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setTextFormatPattern(getDataText(),"$#,###,###,###.##");
setFontSizeInPoints(getO1Label(),9);
setFontSizeInPoints(getY1Label(),9);
setFontSize(getDataText(),10);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),12);
setLegendMarkerPosition(0);
setTransparentBorderColor(getChartBackground(),true);
setRect(getPieFrame(), new Rectangle(-15500,-13500,27000,27000));
setRect(getFrame(), new Rectangle(-10400,-10000,25000,30000));
setTextString(getTitle(),"TOTAL PROFIT BY COUNTRY");
ENDSTYLE
END
-RUN
SET GRAPHSERVURL = 'http://' || '&SERVER.EVAL' || '/ibi_apps/IBIGraphServlet'
SET FOCEXURL = 'http://' || '&SERVER.EVAL' || '/ibi_apps/WFServlet'
-RUN
DEFINE FILE CAR
IMAGE1/A200='<img src=http://' || '&SERVER.EVAL' || '/approot/baseapp/&GIF_FILE1>';
IMAGE2/A200='<img src=http://' || '&SERVER.EVAL' || '/approot/baseapp/&GIF_FILE2>';
X1A/A15 = '<TABLE>';
X1B/A15 = '<TR>';
X1C/A20 = '</TR>';
X1D/A10 = '</TABLE>';
X1E/A30 = '<TD COLSPAN=5 align="left">';
X_END/A5 = '</TD>';
X2A/A30 = '<TD COLSPAN=5 align="right">';
END
TABLE FILE CAR
HEADING
-IF &FMT EQ 'PDF' GOTO SKIP_LINE1A;
"<X1A<X1B<X1E<IMAGE1<X_END<X2A<IMAGE2<X_END<X1C<X1D"
-SKIP_LINE1A
"</14 "
SUM
DEALER_COST/P13.2M AS 'Dealer Cost'
RETAIL_COST/P13.2M AS 'Retail Cost'
COMPUTE PROFIT/P13.2M = RETAIL_COST-DEALER_COST; AS 'Profit'
SALES/P13.2M AS 'Sales'
BY COUNTRY AS 'Country'
BY CAR AS 'Car'
BY MODEL AS 'Model'
BY BODYTYPE AS 'Body Style'
ON COUNTRY SUBFOOT
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT &FMT OPEN
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
LEFTMARGIN=0.0400000,
RIGHTMARGIN=0.050000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
ORIENTATION=LANDSCAPE,
SQUEEZE=ON,
$
TYPE=TITLE, STYLE=BOLD, SIZE=10, FONT=VERDANA,$
TYPE=REPORT, TITLETEXT='Report 1',$
-IF &FMT NE 'PDF' GOTO SKIP_IMAGE1;
TYPE=HEADING, IMAGE='&GIF_FILE1.EVAL', POSITION=(+5.0 +0.00), SIZE=(5.00 2.25), $
TYPE=HEADING, IMAGE='&GIF_FILE2.EVAL', POSITION=(+0.0 +0.00), SIZE=(5.00 2.25), $
-SKIP_IMAGE1
ENDSTYLE
END
-RUN
-SET &ECHO=ALL;
-SET &APPFOLDER = 'baseapp/';
-SET &USERID = GETUSER('A8');
-SET &LC_USER = LOCASE(8, &USERID, 'A8');
-SET &GIF_FILE1 = &LC_USER || 'graph1' || '.jpg' ;
-SET &PATH = &APPFOLDER || &GIF_FILE1;
APP FI GRAPH2 DISK &PATH
-RUN
GRAPH FILE CAR
SUM
RETAIL_COST AS ''
ACROSS COUNTRY
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 205
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH HOLD AS GRAPH2 FORMAT JPEG
ON GRAPH SET STYLE *
TYPE = REPORT, FONT=VERDANA, SIZE=9, $
TYPE = HEADING, FONT=VERDANA, SIZE=10, STYLE=BOLD, $
ENDSTYLE
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setFontName(getDataText(),"Verdana");
setDepthAngle(65);
setPieDepth(45);
restoreAllSlices();
setPieFeelerTextDisplay(2);
setPieTilt(25);
setPieLabelDisplay(0);
setDisplay(getPieLabel(),true);
setLegendAutomatic(false);
setFontStyle(getLegendText(),2);
setFontStyle(getPieSliceLabel(),2);
setTextFormatPreset(getPieSliceLabel(),5);
setFontSizeInPoints(getTitle(),12);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setTextFormatPattern(getDataText(),"$#,###,###,###.##");
setFontSizeInPoints(getO1Label(),9);
setFontSizeInPoints(getY1Label(),9);
setFontSize(getDataText(),10);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),12);
setLegendMarkerPosition(0);
setTransparentBorderColor(getChartBackground(),true);
setRect(getPieFrame(), new Rectangle(-15500,-13500,27000,27000));
setRect(getFrame(), new Rectangle(-10400,-10000,25000,30000));
setTextString(getTitle(),"TOTAL RETAIL COST BY COUNTRY");
ENDSTYLE
END
-RUN
-SET &GIF_FILE2 = &LC_USER || 'graph2' || '.jpg' ;
-SET &PATH = &APPFOLDER || &GIF_FILE2;
APP FI GRAPH2 DISK &PATH
-RUN
GRAPH FILE CAR
SUM
COMPUTE PROFIT/P13.2M = RETAIL_COST-DEALER_COST; AS ' '
ACROSS COUNTRY
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 205
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH HOLD AS GRAPH2 FORMAT JPEG
ON GRAPH SET STYLE *
TYPE = REPORT, FONT=VERDANA, SIZE=9, $
TYPE = HEADING, FONT=VERDANA, SIZE=10, STYLE=BOLD, $
ENDSTYLE
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setFontName(getDataText(),"Verdana");
setDepthAngle(65);
setPieDepth(45);
restoreAllSlices();
setPieFeelerTextDisplay(2);
setPieTilt(25);
setPieLabelDisplay(0);
setDisplay(getPieLabel(),true);
setLegendAutomatic(false);
setFontStyle(getLegendText(),2);
setFontStyle(getPieSliceLabel(),2);
setTextFormatPreset(getPieSliceLabel(),5);
setFontSizeInPoints(getTitle(),12);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setTextFormatPattern(getDataText(),"$#,###,###,###.##");
setFontSizeInPoints(getO1Label(),9);
setFontSizeInPoints(getY1Label(),9);
setFontSize(getDataText(),10);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),12);
setLegendMarkerPosition(0);
setTransparentBorderColor(getChartBackground(),true);
setRect(getPieFrame(), new Rectangle(-15500,-13500,27000,27000));
setRect(getFrame(), new Rectangle(-10400,-10000,25000,30000));
setTextString(getTitle(),"TOTAL PROFIT BY COUNTRY");
ENDSTYLE
END
-RUN
DEFINE FILE CAR
IMAGE2/A200='<img src=http://' || '&SERVER.EVAL' || '/approot/baseapp/&GIF_FILE1>';
IMAGE1/A200='<img src=http://' || '&SERVER.EVAL' || '/approot/baseapp/&GIF_FILE2>';
X1A/A15 = '<TABLE>';
X1B/A15 = '<TR>';
X1C/A20 = '</TR>';
X1D/A10 = '</TABLE>';
X1E/A30 = '<TD COLSPAN=5 align="left">';
X_END/A5 = '</TD>';
X2A/A30 = '<TD COLSPAN=5 align="right">';
END
TABLE FILE CAR
HEADING
-IF &FMT EQ 'PDF' GOTO SKIP_LINE1AB;
"<X1A<X1B<X1E<IMAGE1<X_END<X2A<IMAGE2<X_END<X1C<X1D"
-SKIP_LINE1AB
"</14 "
SUM
DEALER_COST/P13.2M AS 'Dealer Cost'
RETAIL_COST/P13.2M AS 'Retail Cost'
COMPUTE PROFIT/P13.2M = RETAIL_COST-DEALER_COST; AS 'Profit'
SALES/P13.2M AS 'Sales'
BY COUNTRY AS 'Country'
BY CAR AS 'Car'
BY MODEL AS 'Model'
BY BODYTYPE AS 'Body Style'
ON COUNTRY SUBFOOT
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT &FMT CLOSE
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
LEFTMARGIN=0.0400000,
RIGHTMARGIN=0.050000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
ORIENTATION=LANDSCAPE,
SQUEEZE=ON,
$
TYPE=TITLE, STYLE=BOLD, SIZE=10, FONT=VERDANA, $
TYPE=REPORT, TITLETEXT='Report 2',$
-IF &FMT NE 'PDF' GOTO SKIP_IMAGE2;
TYPE=HEADING, IMAGE='&GIF_FILE2.EVAL', POSITION=(+5.0 +0.00), SIZE=(5.00 2.25), $
TYPE=HEADING, IMAGE='&GIF_FILE1.EVAL', POSITION=(+0.0 +0.00), SIZE=(5.00 2.25), $
-SKIP_IMAGE2
ENDSTYLE
END
-RUN
I tried SVG, GIF and JPEG and they all behave the same way.
Here is the code, without any of the Java:
GRAPH FILE HPORTDATA
SUM HPORTDATA.SEG01.RET_DAY_AP
HPORTDATA.SEG01.RET_DAY_AX
BY HPORTDATA.SEG01.BUS_DT NOPRINT
BY HPORTDATA.SEG01.GRP_LBL AS ' '
BY HPORTDATA.SEG01.BUS_DT NOPRINT
ON GRAPH HOLD AS TEST/HGRAPH1 FORMAT SVG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 320
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 3
END
If I try this with the CAR file, it works. I'm guessing it has something to do with those BY NOPRINT statements, but why...
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
From what I remember PDF wants the physical path to the file.
GRAPH FILE CAR
SUM DEALER_COST AS 'D. Cost'
RETAIL_COST AS 'R. Cost'
BY COUNTRY NOPRINT
BY CAR AS ' '
BY MODEL NOPRINT
ON GRAPH HOLD AS GRPH FORMAT SVG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 320
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 3
END
GRAPH FILE CAR
SUM DEALER_COST AS 'Dealer Cost'
RETAIL_COST AS 'Retail Cost'
BY COUNTRY NOPRINT
BY CAR AS ' '
BY MODEL NOPRINT
ON GRAPH HOLD AS IMAGES/GRPH2 FORMAT GIF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 520
ON GRAPH SET VAXIS 320
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 3
END
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL
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,IMAGE=GRPH,POSITION=(0.25000 4.25000),$
TYPE=REPORT,IMAGE=C:\ibi\apps\images\grph2.svg,POSITION=(5.50000 4.25000),$
ENDSTYLE
END
Does it help to remove the HEADING? We've had "weird" issues with graph values disappearing from graphs sometimes if there was a HEADING.
EDIT: Never mind, I forgot that tech support told me that's related to having ON GRAPH SET GRWIDTH 1 in the request, which you don't have.This message has been edited. Last edited by: Wep5622,
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :