Focal Point
Interactive Report

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

July 19, 2004, 08:54 PM
vaayu
Interactive Report
Can anyone give me an idea for an interactive report where I can let my users to pick the columns they want to view in the report including by the items they want to sort.
PRINT &COL1
&COL2
BY &COL3

The problem is I have a html page to start with bunch of check boxes. how can I know how many columns will the user pick at the time of input?
I am not sure if I'm explaining this right, but any ideas would be greatly helpful.

thanks

-P
July 19, 2004, 09:17 PM
jmdoyl1
Below is some code you could use once you get the HTML to pass a name value pair. The Java UI that I have to work with passes FLDSORT0=[0-n]
FLDSRTOR1-n=[value]. I don't think that really aswer but is a dynamic option to building the TABLE statement. If I can determine how the name value pairs are built will add another post.

-SORTFIELD
-SET &CNTR=0;

-LOOPITBY
-SET &CNTR=&CNTR+1;
-SET &LINE1='-IF &' || 'CNTR GT &' || 'FLDSORT0 GOTO STOPLOOPBY;';
&LINE1.EVAL
-SET &LINE2= 'BY ' | '&' | 'FLDSRTOR' | &CNTR.EVAL | ' '
- | '&' | 'FLDSORT' | &CNTR.EVAL | ' NOPRINT' | '';
&LINE2.EVAL
-GOTO LOOPITBY

-STOPLOOPBY
July 19, 2004, 09:28 PM
susannah
well, here's what i do.
you do have checkboxes, right? we're not talking multi-select...right?
I make each checkbox a boolean value;
If say, my users want UNITS and DOLLARS and SEASONS and DIVISIONS
then in my launch page:
NAME MYUNITS VALUE=1 and is NOT checked;
NAME MYDOLS VALUE=1 and is NOT checked;
etc,
Then in my fex:
-DEFAULT &MYUNITS = 0;
-DEFAULT &MYDOLS = 0;
etc
then
-SET &MYVAR1 = IF &MYUNITS IS 1 THEN 'UNITS' ELSE '';
-SET &MYVAR2 = IF &MYDOLLARS IS 1 THEN 'DOLLARS' ELSE ' ' ;
-SET &HOWMANY = &MYUNITS + &MYDOLLARS + more;
..in my fex
SUM &MYVAR1 &MYVAR2
these references are nothing if the variable wasn't checked.
The total &HOWMANY tells me how many vars i gotta make room for in my output.
Does this help? This really is how i do it all the time. But i do actually initialize one of my variables, just to get the ball rolling.
July 19, 2004, 10:13 PM
jmdoyl1
My ealier sample assumes multiselect from the HTML as below:

form method..





Car


Model





This will pass in TEST0=2, TEST1=CAR, TEST2=MODEL.

Jon
July 19, 2004, 10:16 PM
jmdoyl1
oops. To quck on the click. Code was:

input type="checkbox" name="TEST" value="CAR" checked>Car
input type="checkbox" name="TEST" value="MODEL">Model
July 19, 2004, 10:45 PM
vaayu
Thanks guys. That'll give me something to work on.

Appreciate ur help
July 20, 2004, 03:47 PM
<Pietro De Santis>
If you use a multi-select box, there's less code to create. When submitted, a multi-select boxes passes the following variables ("PARMNAME" is the name of your select box): &PARMNAME0 (that's zero) telling you how many values were selected, and &PARMNAME1 ... &PARMNAME99. If only one was selected, then &PARMNAME0 won't exist (which can be tested for in Dialog Manager). This is the easiest way to pass a variable number of parms to WebFOCUS.