Focal Point
Drill on a duplicate field ... any workaround?

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

April 25, 2007, 02:35 PM
GreenspanDan
Drill on a duplicate field ... any workaround?
hi everybody,

i'm having a problem with a report that is heavily parameterized.

one feature of this report is the ability to sort by clicking on the column header. it works by re-running the report passing that column name as a variable so the PRINT statement ends with "BY &SORTFLD NOPRINT". the problem is, any drills i have set up on that field no longer work. i suspect it is applying the drills to the NOPRINTed column now and not the other instance of that field. here's an example:

TABLE FILE WHATEVER
PRINT
FNAME
LNAME
SSN
BY &SORTFIELD NOPRINT
...
TYPE=TITLE,
COLUMN=LNAME,
JAVASCRIPT=sortColumn('LNAME'),
$


if &SORTFIELD equals 'LNAME', it correctly sorts by that field, but any drills i have set up on the LNAME column don't show up anymore.

when the drills are set up, i know you can reference them by their sequential number instead of by name, but that won't work for me in this particular instance because i have other code in there that allows the user to switch up the order of the columns.

i tried making the sortfield a computed field but you can't do that either.

my question is, is there any way to make it apply the drills to the visible column and not the hidden NOPRINT one? i'd appreciate any ideas, as i'm kind of stumped.


---------------------
WebFOCUS 7.6
April 25, 2007, 03:05 PM
Fernando
You can access the second column by placing a (2) after the field in the style sheet

Ex:
..., COLUMN=LNAME(2), drill stuff ...

However, I suspect since you have everything as a parameter you will need 2 style entries. One without the (2) and one with it.

So if they pick a field not in the by they get the first and when they pick one in the by they get the second.

Ex:

..., COLUMN=&SORTFIELD, drill stuff ... happens
when &SORTFIELD is not in the print list

..., COLUMN=&SORTFIELD (2), drill stuff ... happens when &SORTFIELD is in the print list

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
April 25, 2007, 03:09 PM
GreenspanDan
ah, perfect! would there happen to be any way to reference multiple fields with a single "COLUMN="? (like say "COLUMN=&SORTFIELD(1) &SORFIELD(2),"? the drill section is already super-long, i'm not eager to double its size.

thanks for the response!


---------------------
WebFOCUS 7.6
April 25, 2007, 03:15 PM
Francis Mariani
TYPE=TITLE,
COLUMN=LNAME(*),
JAVASCRIPT=sortColumn('LNAME'),


will work - the * applies the drilldown to all columns named LNAME including whether or not there's a BY LNAME NOPRINT

Working example:

-DEFAULT &SORTBY = 'COUNTRY';

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
BY &SORTBY NOPRINT
ON TABLE SET STYLE *
TYPE=TITLE, COLUMN=COUNTRY(*), FOCEXEC=CARTEST111 (SORTBY='COUNTRY'), $
TYPE=TITLE, COLUMN=CAR(*),     FOCEXEC=CARTEST111 (SORTBY='CAR'    ), $
TYPE=TITLE, COLUMN=MODEL(*),   FOCEXEC=CARTEST111 (SORTBY='MODEL'  ), $
TYPE=TITLE, COLUMN=SALES(*),   FOCEXEC=CARTEST111 (SORTBY='SALES'  ), $
ENDSTYLE
END
-RUN


PS. Interesting hairdo, GreenspanDan.

This message has been edited. Last edited by: Francis Mariani,


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
April 25, 2007, 03:19 PM
GreenspanDan
beautiful. and thanks! Smiler


---------------------
WebFOCUS 7.6
April 25, 2007, 08:59 PM
susannah
greenspandan, what is the .js 'sortColumn' ?
is that home grown or is it something from a 76 gui world?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 27, 2007, 11:15 AM
GreenspanDan
oh, that's my own javascript. it'd be a nice built-in feature, though!


---------------------
WebFOCUS 7.6
April 27, 2007, 12:29 PM
susannah
would you share your .js?
we'll applaud.

did you try
ON TABLE SET HOLDLIST PRINTONLY
to see if you get only 1 instance of your drillfield name?
761, btw, has some swell new features for refencing columns. Noreen's webinar from yesterday will be posted soon.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 27, 2007, 02:51 PM
GreenspanDan
i'd gladly post it if it was a quick and easy thing, but it uses .jsp and frames and javascript, it's really pretty messy!


---------------------
WebFOCUS 7.6