Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] embed a database field in graph title ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] embed a database field in graph title ??
 Login/Join
 
Master
posted
It is easy to embed a database field with
freeform text in a regular old table request:

TABLE FILE CAR
HEADING CENTER
" THIS REPORT FOR <COUNTRY "
PRINT 
CAR
MODEL 
SEATS
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
END
-RUN

-EXIT


My problem is how to embed a database field in
freeform text in a graph.

I have created a &HDR_LN1 like so where I want
to embed the PRODNAME database field into a text
string to be displayed in a Graph Title.

-SET &HDR_LN1 = 'Sales of ' | PRODNAME | ' for Each Store';
-TYPE HDR_LN1 = &HDR_LN1

GRAPH FILE CAR
SUM 
CAR
BY MODEL

ACROSS COUNTRY
. . .
. . .

setTitleString('&HDR_LN1');

ENDSTYLE
END


can anyone help me ?

Thanks!

This message has been edited. Last edited by: <Kathryn Henning>,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Wouldn't the same thing work that you used in the TABLE FILE request (with or without the CENTER)?
HEADING CENTER
" THIS REPORT FOR <COUNTRY "
Or, are you looking for something different?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Consider the following, I started this code:
GRAPH FILE CAR
SUM DCOST 
BY COUNTRY 
END
Then opened it with the "Edit in Developer Studio Tool" and followed the GUI tabs to get this:
GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST 
BY CAR.ORIGIN.COUNTRY 
HEADING
"This is a HEADING Line"
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setTitleString("Chart Title");
setFontSizeAbsolute(getTitle(),true);
setSubtitleString("Chart Subtitle");
setFontSizeAbsolute(getSubtitle(),true);
setFootnoteString("Chart Footnote");
setFontSizeAbsolute(getFootnote(),true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     TITLETEXT='Chart Title',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     COLOR='BLACK',
$
ENDSTYLE
END
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Not that elegant, but it's working...

TABLE FILE CAR
BY COUNTRY
ON TABLE SAVE AS 'CNTRYLST' FORMAT ALPHA
END
-RUN

-SET &LOOP = &LINES;
-SET &I    = 1;

-SETVAR
-SET &COUNTRY.&I = '';
-SET &I = &I + 1;
-IF &I LE &LOOP THEN GOTO READCNTRY;

-SET &I    = 1;
-READCNTRY
-READ CNTRYLST &CNTRY.&I.A10.

-SET &COUNTRY.&I = &CNTRY.&I;
-TYPE READ COUNTRY IS: &COUNTRY.&I

-SET &COUNTRY = &COUNTRY.&I;
-SET &TITLE = 'Dealer Cost of Car For &COUNTRY.EVAL';

GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST AS 'Cost'
BY CAR AS ''
WHERE COUNTRY EQ '&COUNTRY';
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setTitleString("&TITLE");
setFontSizeAbsolute(getTitle(),true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
END

-SET &I = &I + 1;
-IF &I LE &LOOP THEN GOTO READCNTRY;


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] embed a database field in graph title ??

Copyright © 1996-2020 Information Builders