Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [solved] Adding a column value into the DRILLMENUITEM title
Go
New
Search
Notify
Tools
Reply
  
[solved] Adding a column value into the DRILLMENUITEM title
 Login/Join
 
Guru
posted
I am trying to add the value that is in a column into the Title of the DRILLMENUITEM. I was able to put in a variable using the code below and it worked. I have tried
TYPE=DATA,
COLUMN=N5,
TARGET='_blank',
DRILLMENUITEM= '&SUB_NAME Today Detail',
FOCEXEC=daily_sales_detail_html( \
SEARCH_SUB=N1 \
),
$

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Reply With QuoteReport This Post
Expert
posted Hide Post
It worked, well done.


Whats the problem ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
Adding a variable worked, which was set before creating the report. But I want to be able to add the value of a column, so that the value that is in a column display in the menu title. It would change depending what row you are on.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Reply With QuoteReport This Post
Expert
posted Hide Post
As far as I am aware, the Drill Menu Item does not accept any dynamic variables.

But...

You may be able to do this with javascript.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Here is a tossed together sample.

Not sure if it will work on all browsers or versions of WebFOCUS, I guess it would have to be tested.

-SET &RANDOM = &TOD ;

TABLE FILE CAR
PRINT COUNTRY
      CAR
      COMPUTE Drill1Text/A40 = 'Drill down to Country ' | COUNTRY ; NOPRINT
      COMPUTE Drill2Text/A40 = 'Drill down to Car ' | CAR ; NOPRINT
ON TABLE SET STYLE *
TYPE=DATA,
COLUMN=N1,TARGET='_self',
DRILLMENUITEM='MultiDrill 1',FOCEXEC=TEST(D1T=Drill1Text CTY=COUNTRY RANDOM='&RANDOM'),
DRILLMENUITEM='MultiDrill 2',FOCEXEC=TEST(D2T=Drill2Text CAR=CAR RANDOM='&RANDOM'),
$
ENDSTYLE
END
-HTMLFORM BEGIN
<script type="text/javascript">
< !--
  function DynoDrill(_I1a,_I1b,_I1c,_I2a,_I2b,_I2c) {
    MDitems[_I1a].text = _I1b.split('&')[0].split('=')[1] ;
    MDitems[_I2a].text = _I2b.split('&')[0].split('=')[1] ;
    MDitemClick(_I1a,_I1b,_I1c,_I2a,_I2b,_I2c);
  }
  var _LinkList = document.getElementsByTagName('A') ;
  for (var _Cntr = 0;_Cntr < _LinkList.length;_Cntr++) {
    var _NewLink = 'javascript:DynoDrill(' + _LinkList[_Cntr].href.toString().split('(',2)[1] ;
    _LinkList[_Cntr].href = _NewLink ;
  }
//-->
</script>
-HTMLFORM END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi,

You can also do this by conditionally creating the drilldowns with WHEN. The drilldowns are created in a loop and the value for each multidrill item is read from a SAVE file.

Cheers,
Mika

TABLE FILE CAR
BY COUNTRY
ON TABLE SAVE
END
-RUN
-SET &countryCNT = &LINES ;

TABLE FILE CAR
SUM SALES
    DEALER_COST
    RETAIL_COST
BY COUNTRY
ON TABLE SET STYLE *
-REPEAT :doDRILL FOR &i FROM 1 TO &countryCNT
-READ SAVE &CTRY.A10
TYPE=DATA,
     COLUMN=COUNTRY,
     WHEN = COUNTRY EQ '&CTRY',
-* Single Country
     DRILLMENUITEM='&CTRY - Detail Report',
         FOCEXEC=sales_detail( \
                 COUNTRY=COUNTRY \
           ),
     TARGET='_blank',
-* All Countries
     DRILLMENUITEM='All Countries - Detail Report',
         FOCEXEC=sales_detail(),
     TARGET='_blank',
$     
-:doDRILL
ENDSTYLE
END
-RUN


WebFOCUS 7.6.x
PMF 5.2.x
 
Posts: 58 | Location: Sydney, Australia | Registered: April 22, 2005Reply With QuoteReport This Post
Guru
posted Hide Post
I finally had the time to test Mika's code and incorporate it into my code which made my application look great.

Thanks


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [solved] Adding a column value into the DRILLMENUITEM title

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.