Focal Point
[SOLVED] Javascript function on first BY-field in report with EXPANDBYROWTREE

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

July 05, 2019, 11:30 AM
JForFun
[SOLVED] Javascript function on first BY-field in report with EXPANDBYROWTREE
Hi guys,

I have a report thats expandable and has the expandbyrowtree option to get the nice accordion structure of the report. However it seems as if I can't place a drilldown link (javascript, navigateToPage) on the first column (i.e. the first BY field).

Example:

SET JSURLS = '/ibi_apps/tools/portalcanvas/iframeinterface.js'

TABLE FILE BASEAPP/CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET BYDISPLAY OFF
ON TABLE SET AUTOFIT OFF
ON TABLE SET EXPANDABLE ON
ON TABLE SET EXPANDBYROWTREE 1
ON TABLE SET DROPBLNKLINE ON
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Flat.sty,$
TYPE = DATA, COLUMN=CAR, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $
TYPE = DATA, COLUMN=COUNTRY, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $
ENDSTYLE
END


On CAR which is my second BY-field it shows the link perfectly. On COUNTRY it doesn't. I also tried altering the last STYLE-line to this:

TYPE = SUBTOTAL, COLUMN=COUNTRY, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $

--> doesn't work either

or this:

TYPE = SUBTOTAL, BY=COUNTRY, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $

--> does work, but changes every column of the whole SUBTOTAL-line to a link and I only want it on the first column.

TYPE = SUBTOTAL, BY=COUNTRY, COLUMN=COUNTRY, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $

--> doesn't work. It seems as if I just can't adress the first column of this report. I also already tried adressing the column as B1, N1, E01, ... nothing works.

Can anyone help me? :/

This message has been edited. Last edited by: JForFun,
July 05, 2019, 12:43 PM
FP Mod Chuck
JforFun

My strength is not javascript but I found this doc that starting on page 306 may help you. https://webfocusinfocenter.inf...pdfs2/wfbiportal.pdf

Not sure what release you are on, this is for version 8.2.02.

I used the code you provided and I do see a link on the COUNTRY field it just doesn't do anything. Based on what I read in the doc you have to specify the portal page name and panel name and parameter names in the call. Your example just say page, panel, param


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 08, 2019, 03:19 AM
JForFun
Of course I know that I have to change Page and param to the ones used in the portal but this doesnt matter since I dont even get the empty link shown on the report.

Which version did you try? I only get the link with the

 TYPE = SUBTOTAL, BY=COUNTRY, JAVASCRIPT=navigateToPage('Page' 'Panel' 'Param' param), $ 


line but that turns the whole row into a link while I only want it on country.

Version is 8.2.04 btw.
July 08, 2019, 05:56 AM
Tony A
I guess that you are hand coding this?

If you are, then try adding OBJECT=TAG, to your line. Just tried this in 8.2.04 and it works OK.

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 
July 08, 2019, 05:59 AM
Tony A
BTW, the syntax is SET JSURL not JSURLS.

Whilst this seems to work in 8.2.04 you should stick to documented syntax in case of code tightening.

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 
July 08, 2019, 09:58 AM
JForFun
THX, Tony, that worked beautifully. Also thank you for the hint on JSURL, I will correct that.