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     [SOLVED] Expandable Report Allows Expansion of Element With No Data.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Expandable Report Allows Expansion of Element With No Data.
 Login/Join
 
Master
posted
I have a TABLE FILE command where I have 'ON TABLE SET EXPANDABLE ON'.

My data is hierarchical in nature, and 'short paths' are possible.

For example:
  
President1	Vice-President1	Manager1
				Manager2
		Vice-Persident2


I am seeing the '+' sign for both Vice-Presidents 1 and 2.

When I click the '+" sign for Vice-President 1, I see her Managers 1 and 2 appear, as expected.

I also see a '+' sign Vice-President 2, even though there are no managers under him (no data concept).

When I click the '+' sign for Vice-President 2, a 'blank' cell appears.

How do I suppress the '+' when there is no data to expand, for a particular Vice-President?

(Apologies for not showing an example, using the IB sample files, but I do not know of a sample file with 'short paths'.)

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




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
I don't think that is supported. As you've seen EXPANDABLE or EXPANDBYROW creates a (+) for each BY field regardless of what values are after.

My thinking is that all short-path did was not to exclude the parent record form the host table by "faking" a child segment with MISSING values but as far as the "expandable control" is concerned, you still have a dependent record to show upon clicking (+) even if all of the values for that child record are blank.

That wouldn't be much different to this I guess:
DEFINE FILE CAR
MODEL1/A20 MISSING ON WITH CAR = MISSING;
MODEL2/A20 MISSING ON = MODEL1;
MODEL3/A20 MISSING ON = MODEL1;
MODEL4/A20 MISSING ON = MODEL1;
END
TABLE FILE CAR
SUM
     MODEL2
     MODEL3
     MODEL4
BY COUNTRY
BY CAR
BY MODEL1
ON TABLE SET EXPANDABLE ON
END



That just my assumption as I haven't used expandable reports myself. I couldn't spot anything in the documentation that would support the idea of not displaying the (+) control if the fields as of the last BY were all MISSING.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Master
posted Hide Post
Thanks for showing me how I can demo this scenario using an IB sample file.

Run the following..:
APP PREPENDPATH IBISAMP
SET NODATA = ' '
DEFINE FILE GGSALES
 NEW_DOLLARS/I8 MISSING ON WITH DOLLARS =  IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250')) THEN MISSING ELSE DOLLARS;
 NEW_PRODUCT/A16 MISSING ON WITH PRODUCT = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE PRODUCT;
 NEW_STCD/A05 MISSING ON WITH STCD = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE STCD;
 NEW_CITY/A20 MISSING ON WITH CITY = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE CITY;
END
-*
TABLE FILE GGSALES
SUM NEW_DOLLARS NOPRINT
BY REGION
 SUM NEW_DOLLARS NOPRINT
 BY REGION
 BY ST
  SUM NEW_DOLLARS NOPRINT
  BY REGION
  BY ST
  BY NEW_CITY
   SUM NEW_DOLLARS NOPRINT
   BY REGION
   BY ST
   BY NEW_CITY
   BY NEW_STCD
    SUM NEW_DOLLARS
    BY REGION
    BY ST
    BY NEW_CITY
    BY NEW_STCD
    BY NEW_PRODUCT
ON TABLE SET EXPANDABLE ON
ON TABLE SET STYLE *
 TYPE=REPORT, SIZE=12, FONT='LUCIDA CONSOLE', GRID='OFF', $
ENDSTYLE
END
-RUN

..and the user sees an opportunity to expand at 'Midwest-MO', which then gives them an 'expectation' of seeing some data.

Yep, I don't think the expandable section of the Active Reports manual, describes a way of handling this.

If there isn't a setting/command to 'hide' the icon, I am hoping for a work-around.

Thank you, again.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
Yep. I know what you mean and it is definitely misleading.

Sadly unless there is a setting "somewhere" in WebFOCUS that allows to hide the (+) control if the underlying value is MISSING I don't think there is much one can do. Frowner



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
I modified your code slightly to have 2 "empty" states: MI and GA.

APP PREPENDPATH IBISAMP
SET NODATA = ' '
DEFINE FILE GGSALES
NEW_DOLLARS/I8 MISSING ON WITH DOLLARS =  IF ((REGION EQ 'Midwest') AND
                                             (STCD EQ 'R1250')) THEN MISSING ELSE DOLLARS;
NEW_PRODUCT/A16 MISSING ON WITH PRODUCT = IF ((REGION EQ 'Midwest') AND
                                             (STCD EQ 'R1250'))  THEN MISSING ELSE PRODUCT;
NEW_STCD/A05 MISSING ON WITH STCD = IF ((REGION EQ 'Midwest') AND
                                          (STCD EQ 'R1250'))  THEN MISSING ELSE STCD;
NEW_CITY/A20 MISSING ON WITH CITY = IF ((REGION EQ 'Midwest') AND 
                                       (STCD EQ 'R1250')) THEN MISSING ELSE
                                    IF ((REGION EQ 'Southeast') AND 
                                       (STCD EQ 'R1041')) THEN MISSING ELSE CITY;
END
-*
TABLE FILE GGSALES
SUM NEW_DOLLARS
BY REGION
BY ST
BY NEW_CITY
BY NEW_STCD
BY NEW_PRODUCT
ON TABLE SET EXPANDABLE ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, SIZE=10, FONT='LUCIDA CONSOLE', GRID='OFF', $
ENDSTYLE
END


Analyzing the resulting HTML I could see this structure for each BY value that is expandable ... let's take Midwest/IL/Chicago as an example:

...
<TD NOWRAP ibiattrc="3" ibiattr="by_1_1" STYLE="display: none; " >
<A href='javascript:toggle("table1","by_1_1_1");'><img border=0 ibiattr="by_1_1_1" src='/ibi_html/javaassist/icons/plus.gif'></A>
Chicago</TD>
...


This is what an "empty" BY value looks like (e.g. Midwest/MO/):

...
<TD NOWRAP ibiattrc="3" ibiattr="by_1_2" STYLE="display: none; " >
<A href='javascript:toggle("table1","by_1_2_1");'><img border=0 ibiattr="by_1_2_1" src='/ibi_html/javaassist/icons/plus.gif'></A>
&|nbsp;</TD>



Now we need some JavaScript magic to select those "empty" columns and hide the (+) icon in them. jQuery would really come in handy!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Please ignore the "|" in &|nbsp; above. I had to put it there so it would show up ... it's just a regular HTML non-breaking space attribute.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
jQuery rocks!!

I created a directory called myjs under /ibi_html and there I put:

- jQuery (minified .js file)
- Custom JavaScript file -> fixexpand.js with the following code:

/* fixexpand.js
 * Look for expandable controls which are empty and hide their (+) icon 
 */

$(function() {
   $('td[ibiattr]:has(img[ibiattr])').each(function() {
	  if($.trim($(this).html().replace(/<A.*\/A>/i, "")) == '&nbsp;') {
		 $('img[ibiattr]', $(this)).hide();
	  }
   });
});   


That routine takes care of hiding the (+) icon of the empty BY values (as I had explained before).

Just add this line *before* the TABLE FILE request in the WebFOCUS code replacing "jquery.js" with the actual filename you downloaded and placed there:


SET JSURLS='/ibi_html/myjs/jquery.js /ibi_html/myjs/fixexpand.js'



It's not perfect and probably not a maintainable solution as the HTML content layout could change in future versions of WebFOCUS but at least gives an idea of what could be done.

Hope this helps.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Master
posted Hide Post
Thank you for your assistance. This workaround is very much the direction I want to head in.

I am having a little trouble with implmenting the workaround..

Here is my focexec, with the addition of the JSURLS statement:
APP PREPENDPATH IBISAMP
SET NODATA = ' '
SET JSURLS = '/approot/common/jquery-1.4.4.js /approot/common/fixexpand.js'
DEFINE FILE GGSALES
 NEW_DOLLARS/I8 MISSING ON WITH DOLLARS =  IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250')) THEN MISSING ELSE DOLLARS;
 NEW_PRODUCT/A16 MISSING ON WITH PRODUCT = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE PRODUCT;
 NEW_STCD/A05 MISSING ON WITH STCD = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE STCD;
 NEW_CITY/A20 MISSING ON WITH CITY = IF ((REGION EQ 'Midwest') AND
                                              (STCD EQ 'R1250'))  THEN MISSING ELSE CITY;
END
-*
TABLE FILE GGSALES
SUM NEW_DOLLARS NOPRINT
BY REGION
 SUM NEW_DOLLARS NOPRINT
 BY REGION
 BY ST
  SUM NEW_DOLLARS NOPRINT
  BY REGION
  BY ST
  BY NEW_CITY
   SUM NEW_DOLLARS NOPRINT
   BY REGION
   BY ST
   BY NEW_CITY
   BY NEW_STCD
    SUM NEW_DOLLARS
    BY REGION
    BY ST
    BY NEW_CITY
    BY NEW_STCD
    BY NEW_PRODUCT
ON TABLE SET EXPANDABLE ON
ON TABLE SET STYLE *
 TYPE=REPORT, SIZE=12, FONT='LUCIDA CONSOLE', GRID='OFF', $
ENDSTYLE
END
-EXIT


I have a file called fixexpand.js that is stored at ibi_parent\apps\common, and looks like this:
/* fixexpand.js
* Look for expandable controls which are empty and hide their (+) icon 
*/

$(function () {
    $('td[ibiattr]:has(img[ibiattr])').each(function () {
        if ($.trim($(this).html().replace(/<A.*\/A>/i, "")) == ' ') {
            $('img[ibiattr]', $(this)).hide();
        }
    });
});


We have previously downloaded jquiry into a file called 'jquery-1.4.4.js' that is stored at ibi_parent\apps\common. The first set of lines, look like this:
/*!
 * jQuery JavaScript Library v1.4.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Nov 11 19:04:53 2010 -0500
 */
(function( window, undefined ) {

// Use the correct document accordingly with window argument (sandbox)
var document = window.document;
var jQuery = (function() {

// Define a local copy of jQuery
var jQuery = function( selector, context ) {
		// The jQuery object is actually just the init constructor 'enhanced'
		return new jQuery.fn.init( selector, context );
	},

	// Map over jQuery in case of overwrite
	_jQuery = window.jQuery,


However, when I run the focexec, I still see the pesky '+' signs, when the cell contains a space.




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
Hey David, it's hard to tell where or what is not working.

I would look at:

1. Making sure the browser is actually finding and loading those 2 javascript pieces and no syntax errors were raised.
Just adding a silly line such as: alert("I'm here"); right after "$(function() {" should be enough to prove that both jQuery and the custom script work!
2. The generated HTML has a similar structure as the one I described above, as that is what guided me to write the jQuery selector as it was.

Keep in mind that I wrote and tested the code I posted using a local installation of Developer Studio 7.7.03 Hotfix 1. I would encourage you to make a test using exactly the code I posted (and similar locations for the javascript libraries if needed) at least to have something we know works. From there, it would be simpler to make minor adjustments to the WebFOCUS code and analyze how the generated HTML changes which may trigger adjustments to the jQuery.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Master
posted Hide Post
Thank you njsden, for the troubleshooting techniques!

Indeed, my TABLE was creating font tags within the table cells.

Once I acounted for this, in the jQuery selector, the focexec was golden. My user was no longer seeing "+'s",where no data exists.

Two code changes to my last post were to:

1. SET NODATA to 'N/A':
SET NODATA = 'n/a'


2. Change the jQuery selector to:
/* fixexpand.js
 * Look for expandable controls which are empty and hide their (+) icon 
 */

$(function () {
    $('td[ibiattr]:has(img[ibiattr])').each(function () {
        work = $(this).html();
        found = work.indexOf("n/a");
        if (found != -1) {
            $('img[ibiattr]', $(this)).hide();
        }
    });
});  


Once again, many thanks.

This message has been edited. Last edited by: David Briars,
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
You're very welcome! I'm glad the technique helped.

I personally dislike those internal FONT tags which is why I prefer to always use ON TABLE SET HTMLCSS ON.

My only extra piece of advice is to make sure that none of your BY fields ever contains the "n/a" string otherwise you'll lose the expandable icon. That's why the original script tests for an exact match (==) after removing the A tag as opposed to a partial one (indexOf). If you know your data will never provide a "false match" then this shouldn't be an issue.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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     [SOLVED] Expandable Report Allows Expansion of Element With No Data.

Copyright © 1996-2020 Information Builders