Focal Point
[solved] Adding a column value into the DRILLMENUITEM title

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

April 12, 2012, 12:19 PM
Jay Potter
[solved] Adding a column value into the DRILLMENUITEM title
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
April 12, 2012, 05:49 PM
Waz
It worked, well done.


Whats the problem ?


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!

April 12, 2012, 05:57 PM
Jay Potter
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
April 12, 2012, 06:09 PM
Waz
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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 12, 2012, 06:45 PM
Waz
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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 16, 2012, 01:41 AM
Mika Keranen
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
April 24, 2012, 09:49 AM
Jay Potter
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