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 email@example.com for further assistance. Reference the community FAQ to learn more about the community.
We are trying to do something strange. Basically we want to draw boxes around certain parts of data.
Please consider the following code... divider2.gif is a simple grey box that is 8x6 pixels.
TABLE FILE CAR SUM CNT.SALES BY COUNTRY SUM SALES BY COUNTRY PAGE-BREAK BY MODEL ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * -*VERTICAL LINES TYPE=REPORT, IMAGE=/mypath/to/divider2.gif, POSITION=(2.0 0.8), SIZE=(0.04 1.24), $ TYPE=REPORT, IMAGE=/mypath/to/divider2.gif, POSITION=(4.5 0.8), SIZE=(0.04 1.24), $ -*HORIZONTAL LINES TYPE=REPORT, IMAGE=/mypath/to/divider2.gif, POSITION=(2.0 0.8), SIZE=(2.5 0.04), $ TYPE=REPORT, IMAGE=/mypath/to/divider2.gif, POSITION=(2.0 2.0), SIZE=(2.5 0.04), $ ENDSTYLE END
I wish I could upload the resulting pdf. Anyway, there is a box being drawn around the models.
The problem is that we need to change the size of the box on each page. If you could scroll through the 5 pages of the generated pdf you would see that the box is too big on pages 2 and 4, and the box is too small on page 5.
So we need to dynamically change the SIZE of the image on each page based on the value of CNT.SALES.
I have been messing around with this for awhile and I can't figure a way to make it work.
The resulting code would look something like...
-SET &YVAL=(a variable representing the value of CNT.SALES)/SOMEVALUE;
I have been thinking about this... and I came up with the following ... which does work. However I discovered something unbelievable, DM variables must be alpha or int but cannot be decimals. So this won't really work, since I need the size to be specified with 2 decimals.
Anyway this code does work and produces an image that has a varying length on each page. But without decimals its a no go.
SET ASNAMES=ON SET HOLDLIST=PRINTONLY TABLE FILE CAR SUM COMPUTE MYCOUNT/D6=CNT.SALES; NOPRINT COMPUTE MYCOUNTA/A8=FTOA(MYCOUNT, '(D6)', 'A8'); BY COUNTRY ON TABLE HOLD AS MYHOLD FORMAT ALPHA END -SET &MYRECS=&LINES;
-*READ THE DATA INTO A LOOP -RUN -SET &I=0; -STRT_READ -SET &I=&I+1; -READ MYHOLD &MYCOUNTRY.&I.A10. &MYCOUNT.&I.A8.
-TYPE PAGE &I WILL HAVE &MYCOUNT.&I RECORDS -SET &OPENCLOSE=IF &I EQ &MYRECS THEN 'CLOSE' ELSE 'OPEN';
TABLE FILE CAR SUM SALES BY COUNTRY BY MODEL HEADING "THERE WILL BE &MYCOUNT.&I RECORDS" WHERE COUNTRY EQ '&MYCOUNTRY.&I'; ON TABLE PCHOLD FORMAT PDF &OPENCLOSE ON TABLE SET STYLE * -*VERTICAL LINES TYPE=REPORT, IMAGE=/mypath/divider2.gif, POSITION=(1.4 0.8), SIZE=(0.04 &LENGTH), $ TYPE=REPORT, IMAGE=/mypath/divider2.gif, POSITION=(3.9 0.8), SIZE=(0.04 &LENGTH), $ -*HORIZONTAL LINES TYPE=REPORT, IMAGE=/home/IBI/ibi/apps/divider2.gif, POSITION=(1.4 0.8), SIZE=(2.5 0.04), $ TYPE=REPORT, IMAGE=/home/IBI/ibi/apps/divider2.gif, POSITION=(1.4 &YPOS), SIZE=(2.5 0.04), $ ENDSTYLE END
jodye i like your idea how about this: do no math in DM, do it all in your preparation fex; Calculate the complete final value you'll need as a D6.2 the hold the temp file FORMAT ALPHA like you did but without the FTOA then -READ it as .A6 or however long it has to be (better test) and the value for &LENGTH or for &POS , if it were, for example, 0.04 , will be handled as an alpha field by dm Then when you plop it into your fex, the fex will interpret it as a number.
i don't even think you'll need a .EVAL. I always follow my &VARS by a blank space , tho &LENGTH) i would write as &LENGTH )This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003