Focal Point
[SOLVED]Hide expandable sign in accordion report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7977050186

March 03, 2016, 12:57 AM
Hemin
[SOLVED]Hide expandable sign in accordion report
Hi,
In my Accordion report , i just want to hide few records from expansion (showing details part ). Eg: In Car sales table, there are column values like Audi, BMW, Jaguar, Toyota. Here Jaguar and Toyota should not be expandable. Please help me out.

This message has been edited. Last edited by: <Emily McAllister>,


Apps Studio 8.1.0.5
Windows 7
March 03, 2016, 10:34 AM
SWES
Hmm good question.. as far as I know the accordion button is either there for every row/or not. I have not come across any other options/examples where this is different. I do believe it would be a good NFR for IBI to have an option where it does not show when there are no lines under the button for example.


WebFOCUS 8105m
Windows 7, All Outputs

Member of the Benelux Usergroup
March 04, 2016, 12:24 AM
Hemin
Thanks for the reply. Any other suggestions apart from focus coding like javascript, css etc.


Apps Studio 8.1.0.5
Windows 7
March 04, 2016, 07:05 AM
Neelima
Hi Hemin,

Please refer below link

http://forums.informationbuild...=999104622#999104622

and sample code

TABLE FILE CAR
PRINT
SALES
COMPUTE HIDE/A1=IF SALES EQ 0 THEN 'Y' ELSE 'N'; NOPRINT
BY COUNTRY NOPRINT
ON COUNTRY SUBHEAD
"ON TABLE HOLD AS H001 FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=DATA, CLASS=NS, WHEN=HIDE EQ 'Y', $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN

!IBI.FIL.H001.HTM;
-HTMLFORM END

Thanks
Neelima


WebFocus 8104,8204
Excel/PDF/HTML/HTMLTABLE/XML/ALPHA/GIF file/GRAPH/Active technologies
March 17, 2016, 05:51 AM
Hemin
Thanks Neelima... and sorry too for late reply. Was off for few days. Smiler


Apps Studio 8.1.0.5
Windows 7
March 17, 2016, 06:59 AM
Tony A
If specific values should not be expandable, it would be of little use "hiding" the "clickable" gif upon which the event is fired. You would really need to remove the event for the specific values - and that would be difficult to achieve depending upon your requirements and how much the report data varies.

So, how about removing the resultant row detail for those specific values? This would be much easier to control entirely within WebFOCUS without having to concoct some complex JavaScript (most likely) method to remove the image and events for specific nodes.

Would this approach satisfy the requirement? Instead of MISSING for D_MODEL, you could output "NOT PERMITTED" or similar?

SET NODATA = ''
DEFINE FILE CAR
  D_MODEL/A25   MISSING ON = IF CAR IN ('JAGUAR','TOYOTA') THEN MISSING ELSE MODEL;
  D_RCOST/D12.2 MISSING ON = IF CAR IN ('JAGUAR','TOYOTA') THEN MISSING ELSE RETAIL_COST;
  D_DCOST/D12.2 MISSING ON = IF CAR IN ('JAGUAR','TOYOTA') THEN MISSING ELSE DEALER_COST;
END

TABLE FILE CAR
  SUM D_RCOST
      D_DCOST
   BY COUNTRY
   BY CAR
   BY D_MODEL
ON TABLE SET EXPANDABLE ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  grid=off, font=calibri, size=9, $
ENDSTYLE
END
-RUN

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 17, 2016, 07:12 AM
Hemin
Tony A , thanks for the consideration .Removing resultant wouldn't satisfy the requirement.


Apps Studio 8.1.0.5
Windows 7
March 17, 2016, 09:52 AM
Francis Mariani
Using jQuery, here is some JS that hides the accordion button and hyperlink anchor for a specific row. The JS is in a file that is attached to the Accordion report using ON TABLE SET JSURL 'jsFileName.js'.

For one row, I am selecting by content, in the other row, I am selecting by ID.

$(document).ready(function()
{
    // if "Star Trek" Level 2 section row exists, hide the accordion button and hyperlink anchor
    $( "td:contains('Star Trek'):not(:contains('Star Trek Transfer'))" ).each( function()
    {
        $( this ).find( "img" ).css("visibility", "hidden" );
        $( this ).find( "a"   ).css("visibility", "hidden" );
    });

    // if "Klingon Forwards" Level 1 section row exists, hide the accordion button and hyperlink anchor and remove the lower level rows
    $( "#by_2" ).each( function()
    {
        // hide the accordion button and hyperlink anchor to the lower level rows
        $( "#by_2 img"     ).css("visibility", "hidden" );
        $( "#by_2 a:first" ).css("visibility", "hidden" );

        // remove lower level rows (created as requirement of Accordion report)
        $( "tr[ibiattr^='by_2']" ).remove();
    });
});

Read up on jQuery selectors ...

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
March 18, 2016, 05:05 AM
Tony A
Smiler You can always rely on Francis to come up with the goods - he just can't help himself - which is why he and other members make this forum one of the best!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 18, 2016, 05:06 AM
Tony A
Note: The jQuery that Francis gives works excellently with EXPANDABLE = ON but not with EXPANDBYROW.

But then he's given the idea, you just have to work with it!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 21, 2016, 10:00 AM
Francis Mariani
I always forget about EXPANDBYROW. I've been at it for a long time and I've never created an EXPANDBYROW accordion report. I'm fairly sure it would be possible to use a jQuery selector for these types of reports, though you could probably use native JavaScript: Sitepoint: Native JavaScript Equivalents of jQuery Methods: the DOM and Forms


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