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] Hide rows in HTML output

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Hide rows in HTML output
 Login/Join
 
Silver Member
posted
All,

I have a report request that I am trying to figure out how to handle. They would like the report rows collapsed/hidden until selected for view. For example when the report is first dispalyed they would like only the COUNTRY rows displayed, but then they would like to be able to click next to ENGLAND and have that protion expand (along with leaving the other COUNTRY rows unexpanded). Can someone give me some guidance on how to do this. I have been looking at some javascript, but not exactly sure what is really usable.

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


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Expert
posted Hide Post
IMHO, Keep it in WebFOCUS and use the DRILLDOWN functionality. I, personally, don't care to add JavaScript to a WebFOCUS procedure when WebFOCUS can, in fact, do what you want.
-Doug
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
DW,

You should create an ACCORDION report. The command for that is:
ON TABLE SET EXPANDABLE ON


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
Look into "Accordion Reports", here is a simple example:

TABLE FILE CAR
SUM RCOST
    DCOST
 BY COUNTRY
 BY CAR
 BY MODEL
ON TABLE HOLD AS H00A FORMAT HTML
ON TABLE SET EXPANDABLE ON
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  GRID=OFF, SIZE=9, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
!IBI.FIL.H00A;
-HTMLFORM END


Documentation: Creating Reports With WebFOCUS Language > Navigating Within an HTML Report > Controlling the Display of Sorted Data With Accordion Reports


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
Guru
posted Hide Post
If you have some summary columns, accordion reports may not suffice. There is also the OLAP option.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Silver Member
posted Hide Post
Doug - I would love to just do drilldowns, however the requirements is that everything at the higher level must stay visible. I have pitched just drilling down to the various levels with no success with the end user.

On the Accordian report, the issue there is that I Want to make sure that all the "detail" feilds always display, no matter which By Level they are at. The basic use of the Accordian Report is perfect for what I need, if I can figure out how to always show the detail fields (basically I have detail to show at each level For example England would have the total sales for all english cars, so I want that row to always show detail If someone can tell me how to do that I'll be golden


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Silver Member
posted Hide Post
With OLAP the problem seems to be that I am unsure how to only show the rows at the levels that were requested (ie show all Country Totals, but only the CAR totals for the countries that were selected.


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Virtuoso
posted Hide Post
DW,
This is a possible solution:
  
TABLE FILE CAR
SUM SALES
BY COUNTRY
SUM SALES
BY COUNTRY
BY CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
PRINT
     SALES
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET EXPANDABLE ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
It you used multiverb request with the accordion, would that help?

Regards,
Mika

TABLE FILE CAR
SUM RCOST
DCOST
BY COUNTRY

SUM RCOST
DCOST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET EXPANDABLE ON
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF, SIZE=9, $
ENDSTYLE
END
-RUN


WebFOCUS 7.6.x
PMF 5.2.x
 
Posts: 58 | Location: Sydney, Australia | Registered: April 22, 2005Report This Post
Silver Member
posted Hide Post
Expandable doesn't even really work as it expands it across the page.. Here is what the output look like currently. What I want to do is make it so that the car and makes are hidden until I expand the country. But they need to appear on their own lines. I figure this probably has to be done with javascript, but how to apply it is the problem I am having.

If you'd like to create the report you can do so with the following code:

  
-* File testCARORDERING.fex
TABLE FILE CAR
SUM COUNTRY/A50 AS 'COL1'
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= 0;
COMPUTE ORDERC /I5= 0;
BY COUNTRY NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS DATA FORMAT ALPHA
END
-RUN
FILEDEF DATA DISK DATA.FTM (APPEND
-RUN
TABLE FILE CAR
SUM  COMPUTE COL1/A50= '  ' | CAR;
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= IF CAR NE LAST CAR THEN LAST ORDERB + 1 ELSE LAST ORDERB;
COMPUTE ORDERC /I5= 0;
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS DATA FORMAT ALPHA
END
-RUN
TABLE FILE CAR
SUM COMPUTE COL1/A50= '    ' | MODEL;
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= IF CAR NE LAST CAR THEN LAST ORDERB + 1 ELSE LAST ORDERB;
COMPUTE ORDERC/I5= IF MODEL NE LAST MODEL THEN LAST ORDERC + 1 ELSE LAST ORDERC;
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS DATA FORMAT ALPHA
END
-RUN
TABLE FILE DATA
PRINT RETAIL_COST DEALER_COST
BY ORDERA NOPRINT
BY ORDERB NOPRINT
BY ORDERC NOPRINT
BY COL1
ON TABLE SET SHOWBLANKS ON
END


COL1 RETAIL_COST DEALER_COST
ENGLAND 45,319 37,853
JAGUAR 22,369 18,621
V12XKE AUTO 8,878 7,427
XJ12L AUTO 13,491 11,194
JENSEN 17,850 14,940
INTERCEPTOR III 17,850 14,940
TRIUMPH 5,100 4,292
TR7 5,100 4,292
FRANCE 5,610 4,631
PEUGEOT 5,610 4,631
504 4 DOOR 5,610 4,631


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Expert
posted Hide Post
FML with a hierarchy?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
This is a very simplistic example of hiding and showing rows:

-*-- Hide and Show DIVS to demonstrate displaying extra data for a cell on a report
-SET &ECHO=ALL;

SET HOLDLIST   = PRINTONLY
SET ASNAMES    = ON
SET HOLDFORMAT = ALPHA
SET PAGE       = NOLEAD
-RUN

DEFINE FILE CAR
NOTE/A50 =
IF COUNTRY IN ('ITALY', 'W GERMANY') THEN 'This is a note for Group 1' ELSE
IF COUNTRY IN ('ENGLAND', 'JAPAN')   THEN 'This is a note for Group 2' ELSE 'This is a note for Group 3';
END
-RUN

TABLE FILE CAR
PRINT
COUNTRY
NOTE
CAR
MODEL
DEALER_COST
RETAIL_COST
SALES
COMPUTE COUNTER/I4 = COUNTER + 1;

BY COUNTRY                  NOPRINT
BY CAR                      NOPRINT
BY MODEL                    NOPRINT

ON TABLE HOLD AS H001
END
-RUN

DEFINE FILE H001
LINK_OPEN/A125 = IF NOTE EQ '' THEN '' ELSE
'<img id="idI' || EDIT(COUNTER) ||
'" src="/approot/baseapp/1.gif" width="9" height="9"' ||
' onClick="fnToggle(''' || EDIT(COUNTER) || ''')">';

NOTE_EXTRA/A999 = IF NOTE EQ '' THEN '' ELSE
'</TD>' ||
'<tr><td></td><td colspan=5 class="Detail">' ||
'<div id="idC' || EDIT(COUNTER) || '" style="display: ''none'';">' ||
NOTE ||
'</div>' ||
'</td></tr>'
;
END
-RUN

TABLE FILE H001
PRINT
LINK_OPEN           AS ''
COUNTRY             AS 'Country'
CAR                 AS 'Car'
MODEL               AS 'Model'
DEALER_COST         AS 'Dealer,Cost'
RETAIL_COST         AS 'Retail,Cost'
SALES               AS 'Sales'
NOTE_EXTRA          AS ''

BY COUNTRY          NOPRINT
BY CAR              NOPRINT
BY MODEL            NOPRINT

ON COUNTRY SUBHEAD
" "

HEADING CENTER
"Car Sales"
" "

ON TABLE HOLD AS H002 FORMAT HTMTABLE

ON TABLE SET STYLE *
TYPE=REPORT,  GRID=OFF, SQUEEZE=ON, $

TYPE=HEADING, CLASS=Heading, $

TYPE=TITLE,   CLASS=Title, $
TYPE=TITLE,   COLUMN=P1, CLASS=Blank, $
TYPE=TITLE,   COLUMN=P8, CLASS=Blank, $

TYPE=DATA,    CLASS=Data, $
TYPE=DATA,    COLUMN=P1, CLASS=Blank, $
TYPE=DATA,    COLUMN=P8, CLASS=Blank, $
ENDSTYLE
END
-RUN
-IF &FOCERRNUM NE 0 GOTO FOC_ERROR;

-SET &ECHO=OFF;

-HTMLFORM BEGIN
<html>
<head>
<title>Car Test</title>
<style>

TABLE
  { font-family: Verdana, sans-serif; font-size: 7pt; }
</style>

<script language="JavaScript">

function fnToggle(vCounter)
{
vDIV = eval("idC" + vCounter);
vIMG = eval("idI" + vCounter);

if (vDIV.style.display == 'none')
  {
  vDIV.style.display = '';
  vIMG.src = "/approot/baseapp/0.gif";
  }
else
  {
  vDIV.style.display = 'none';
  vIMG.src = "/approot/baseapp/1.gif";
  }
}
</script>
</head>

<body>
<center>

!IBI.FIL.H002;

</center>
</body>
</html>
-HTMLFORM END
-EXIT

-FOCERROR
-EXIT


I hope you find something of use here. It relies on these two images: (named 0.gif and 1.gif)


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
Expert
posted Hide Post
I can see your dilemma with OLAP. But, a drilldown to another fex should work. If not, have you considered the Active Reports?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
I also remember seing the following code somewhere in the forum (apologies to the original author - can't remember who it was) that was so cool I stored it in a back corner. It does something similar to what you are looking for. The code might not do exactly what you need but the concept may get you where you want to go.
DEFINE  FILE CAR
 Key/A26         = COUNTRY | CAR ;
 Id/A26          = CTRAN(26,Key,32,95,Id) ;
 ShowDetail/A100 = '<input type=checkbox onclick="funShowHide[this.checked,''' | Id | ''')">' ;
 Control/A60     = '<input type=hidden name="' | Id | '">' ;
END
TABLE   FILE CAR
 PRINT
        MODEL
        BODYTYPE
        SEATS
        DEALER_COST
        RETAIL_COST
        SALES
        Control      AS ''
 BY     COUNTRY   NOPRINT
 BY     CAR       NOPRINT
 ON     CAR SUBHEAD
        " "
        "<COUNTRY> <CAR>"
        "Show Detail <ShowDetail "
 ON     TABLE HOLD AS CTRL_RPT FORMAT HTMTABLE
 ON     TABLE SET HTMLCSS ON
 ON     TABLE SET STYLE *
TYPE=SUBHEAD, SIZE=12, $
TYPE=DATA, CLASS=cssHide, $
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<STYLE>
.cssHide {
 display: none ;
}
.cssShow {
 display: inline ;
}
</STYLE>
<script language="JavaScript">
 function funShowHide(_State,_Key) {
  var _Lines = document.getElementsByName(_Key) ;
  for (_c1=0;_c1<_Lines.length;_c1++) {
    var _TD = _Lines[_c1].parentElement ;
    var _TR = _TD.parentElement ;
    for (_c2=0;_c2<_TR.childNodes.length - 1 ; _c2++) {
      _TR.childNodes[_c2].className=_State?'cssShow':'cssHide';
    }
  }
 }
</script>
</head>
!IBI.FIL.CTRL_RPT;
</html>
-HTMLFORM END
-RUN


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
quote:
I also remember seing the following code somewhere in the forum


That mine, I was wondering where I left it. Big Grin


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
DW,

You could drill down recursively to your own fex and thus on each click go to the next level:
  
-* File dwf3.fex
-SET &ECHO=ALL;
-DEFAULT &COUNTRY=' ', &CAR=' ', &MODEL=' '
TABLE FILE CAR
SUM COMPUTE COL1/A50= '    ' | MODEL;
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= IF CAR NE LAST CAR THEN LAST ORDERB + 1 ELSE LAST ORDERB;
COMPUTE ORDERC/I5= IF MODEL NE LAST MODEL THEN LAST ORDERC + 1 ELSE LAST ORDERC;
BY COUNTRY 
BY CAR 
BY MODEL 
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS DATA FORMAT ALPHA
END
FILEDEF DATA DISK DATA.FTM (APPEND
-RUN

DEFINE FILE CAR
C/A16=' ';
M/A24=' ';
END
TABLE FILE CAR
SUM  COMPUTE COL1/A50= '  ' | CAR;
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= IF CAR NE LAST CAR THEN LAST ORDERB + 1 ELSE LAST ORDERB;
COMPUTE ORDERC /I5= 0;
BY COUNTRY 
BY CAR
BY M 
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS DATA FORMAT ALPHA
END
-RUN
TABLE FILE CAR
SUM COUNTRY/A50 AS 'COL1'
    RCOST
 DCOST
COMPUTE ORDERA/I5= IF COUNTRY NE LAST COUNTRY THEN LAST ORDERA + 1 ELSE LAST ORDERA;
COMPUTE ORDERB/I5= 0;
COMPUTE ORDERC /I5= 0;
BY COUNTRY
BY C
BY M

ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS DATA FORMAT ALPHA
END
-RUN
TABLE FILE DATA
PRINT RETAIL_COST DEALER_COST
BY ORDERA NOPRINT
BY ORDERB NOPRINT
BY ORDERC NOPRINT
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY MODEL  NOPRINT
BY COL1
-IF &MODEL NE ' ' GOTO #COUNTRY;
-IF &CAR NE ' ' GOTO #MODEL;
-IF &COUNTRY NE ' ' GOTO #CAR; 
-#COUNTRY
WHERE CAR EQ ' '
WHERE MODEL EQ ' '
-GOTO #SHOW
-#CAR
WHERE (COUNTRY EQ '&COUNTRY' AND CAR NE ' ') OR (CAR EQ ' ')
WHERE MODEL EQ '&MODEL'
-GOTO #SHOW
-#MODEL
WHERE (COUNTRY EQ '&COUNTRY' AND CAR EQ '&CAR' AND MODEL NE ' ' )
   OR (COUNTRY EQ '&COUNTRY' AND CAR EQ '&CAR' AND MODEL EQ ' ' )
   OR (CAR EQ ' ' AND MODEL EQ ' ')
-#SHOW
ON TABLE SET SHOWBLANKS ON
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=COL1, FOCEXEC=DWF3(COUNTRY=COUNTRY CAR=CAR MODEL=MODEL), $
ENDSTYLE
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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] Hide rows in HTML output

Copyright © 1996-2020 Information Builders