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     Displaying random multiple graphs on the same page

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Displaying random multiple graphs on the same page
 Login/Join
 
Member
posted
I thought about this for a while and I couldnt succeed to come with a working solution.

Here is an example:

TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND'
-----------------------------------------------
COUNTRY CAR
ENGLAND JAGUAR
JENSEN
TRIUMPH


-----------------------------------------------

Now I would like to display multiple graphs (4/page) depending on the cars in a country. So I will have 3 graphs for England, 1 for France etc(depending on the country input).

The idea was to have a loop and store the car value in a variable that will ultimately be a hold file to be used in html
(eg !IBI.FIL.&COUNTER). My main problem is determining the number of graphs to display since I will have to have the html code defined in advance.




.......
etc

!IBI.FIL.GRAPH1;


How will I determine the html code above in advance without knowing how many graphs I will have?

Thanks in advance.
 
Posts: 24 | Registered: June 16, 2006Report This Post
Expert
posted Hide Post
Try running this code:
-SET &ECHO=ALL;

-SET &HOLDFNUM = 0;

TABLE FILE CAR
SUM COUNTRY BY COUNTRY
ON TABLE HOLD AS HOLDCO FORMAT ALPHA
END
-RUN

-SET &CO_LINES = &LINES;

-REPEAT ENDLOOP1A FOR &NCO FROM 1 TO &CO_LINES STEP 1;
-READ HOLDCO NOCLOSE &CO.A10.
-TYPE --- PROCESSING COUNTRY &CO
TABLE FILE CAR
SUM CAR BY CAR
WHERE COUNTRY EQ '&CO'
ON TABLE HOLD AS HOLDCA FORMAT ALPHA
END
-RUN

-SET &CA_LINES = &LINES;

-REPEAT ENDLOOP2A FOR &NCA FROM 1 TO &CA_LINES STEP 1;

-READ HOLDCA NOCLOSE &CA.A16.
-TYPE ---   PROCESSING CAR &CA
-SET &HOLDFNUM = &HOLDFNUM + 1;
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ '&CO'
WHERE CAR EQ '&CA'
ON TABLE HOLD AS HOLDF&HOLDFNUM FORMAT HTMTABLE

ON TABLE SET PAGE NOPAGE
END
-RUN

-ENDLOOP2A

-ENDLOOP1A

-REPEAT ENDLOOP3A FOR &HFN FROM 1 TO &HOLDFNUM STEP 1;

-HTMLFORM BEGIN
!IBI.FIL.HOLDF&HFN;
-HTMLFORM END

-ENDLOOP3A
It loops through the COUNTRY values and the respective CAR values, creating a report for each. Then it creates one HTML page with all the reports embedded. I didn't create graphs and didn't create multiple pages.

This will work for HTML. If you require PDF output, try the looping suggested here along with Compound reporting.

I hope this put you in the right direction.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thanks Francis.

That showed me a couple of things that I can try to accomplish what I am doing.
 
Posts: 24 | Registered: June 16, 2006Report This Post
Expert
posted Hide Post
tex,in a similar vein to what Francis has suggested,
I first determine how many grafs i'll have,
by preparing an extract file and counting something or other, &MAXKOUNTER ...
then prepare all my grafs, tables, and images in the agent, all numbered by some kounter

-SET &MYGRAF= 'HGRF' | &KOUNTER ;
GRAPH FILE HOLD
...
ON TABLE HOLD AS &MYGRAF FORMAT HTMTABLE
END
then loop thru the kounters from 1 up to their max value and dump them all out
-HTMLFORM BEGIN
<table>
-REPEAT somelabel &MAXKOUNTER TIMES
<tr><td>
<TD>!IBI.FIL.MYPIC1;
<TD>!IBI.FIL.MYTAB1;
<TD>!IBI.FIL.MYGRAF1;
</TR>
-somelabel
-HTMLFORM END

all sorts of wild variations on this theme are possible. but the key is that i prepare them all in the agent, then dump them all when done using HTMLFORM and lots of embededded DM inside the HTMLFORM. Give you any ideas?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     Displaying random multiple graphs on the same page

Copyright © 1996-2020 Information Builders