[SOLVED] how to pass several values of one parameter when drilldown
hi guys code first: -SET &ECHO=ALL; -DEFAULTS &PRO_CODE='''CA0JJB001'',''CA0JJB002'''; TABLE FILE RP_PRODUCT_RATE_CPM SUM SALESPLAN_WEEK_QU BY WEEK_HAIER BY PRO_CODE WHERE PRO_CODE IN (&PRO_CODE); -*WHERE WEEK_HAIER IN ('11','9','10');
HEADING "" FOOTING "" ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * $ TYPE=TITLE, COLUMN=N2, DRILLMENUITEM='to product_code', FOCEXEC=TESTPCT(PRO_CODE='&PRO_CODE'), TARGET='_self', $
ENDSTYLE END
the parameter pro_code has several values, what should i do to pass it to another .fex when drilldown?
it displays like this js info when mouser on pro_code title javascript:MDiteClick(0,'PRO_CODE=&CAOJJB001','CAOJ00B002''=','');
wf version: 7.65This message has been edited. Last edited by: Kerry,
webfocus 7.65 windows xp sp3 excel,html ,pdf,and graph
February 25, 2010, 03:26 PM
Francis Mariani
The working code below should be self-explanatory.
&COUNTRY is the variable passed to the fex from a launch page or from the multi-drilldown click.
&COUNTRY_JS translates the single-quotes to double-quotes to enable the internal WebFOCUS JavaScript function to work.
&COUNTRY1 translates the double-quotes to single-quotes for use in the WebFOCUS filter. Double-quotes are passed to &COUNTRY only from the multi-drilldown click, not from a launch page.
-* File swell1.fex
-SET &ECHO=ALL;
-DEFAULT &COUNTRY = '''ENGLAND'',''FRANCE''';
-*-- if execution of this fex was from a multi-drilldown click, translate the " to '
-SET &COUNTRY1 =
- IF POSIT(&COUNTRY, &COUNTRY.LENGTH, '"', 1, 'I6') GE 1
- THEN CTRAN(&COUNTRY.LENGTH, &COUNTRY, BYTVAL('"','I3'), BYTVAL('''','I3'), 'A&COUNTRY.LENGTH')
- ELSE &COUNTRY;
-*-- translate ' to " for multi-drilldown links - required for the internal WebFOCUS JavaScript
-SET &COUNTRY_JS = CTRAN(&COUNTRY.LENGTH, &COUNTRY, BYTVAL('''','I3'), BYTVAL('"','I3'), 'A&COUNTRY.LENGTH');
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY IN (&COUNTRY1);
HEADING
"&COUNTRY1"
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=TITLE, COLUMN=N2,
DRILLMENUITEM='to Countries',
FOCEXEC=SWELL1(COUNTRY='&COUNTRY_JS'),
TARGET='_self',
$
TYPE=TITLE,
STYLE=BOLD,
$
ENDSTYLE
END
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
February 25, 2010, 09:51 PM
swell.wang
francis thanks a lot it worked ~~
but now i have another question
when i change the code : TYPE=TITLE, COLUMN=N2, DRILLMENUITEM='to Countries', FOCEXEC=SWELL1(COUNTRY='&COUNTRY_JS'), TARGET='_self', $
It also worked .bu when i add the drillmenuitem it will display an error. why it happened? error code TYPE=TITLE, COLUMN=N2, DRILLMENUITEM='to Countries', FOCEXEC=SWELL1(COUNTRY=&COUNTRY.QUOTEDSTRING), TARGET='_self', $
webfocus 7.65 windows xp sp3 excel,html ,pdf,and graph
February 26, 2010, 04:20 PM
Francis Mariani
A normal drilldown does not use JavaScript (unless you specify a JS function - that you have control over). A drilldown with DRILLMENUITEM uses JavaScript functions provided by Information Builders, and that's where the quote problem occurs. If you only have one drilldown, don't use DRILLMENUITEM.
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
February 28, 2010, 01:36 AM
swell.wang
got it. many thanks
webfocus 7.65 windows xp sp3 excel,html ,pdf,and graph