Focal Point
[SOLVED] How to add "all" capability to variable populated with dynamic list

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

October 03, 2008, 04:14 PM
JDroke
[SOLVED] How to add "all" capability to variable populated with dynamic list
Is there any way within Report Painter or the source code to add "ALL" (with FOC_NONE) as a selectable value on a parameter that is populated with a dynamic list (from a table)? I know you can do this with the HTML Painter but I'm talking about just a report created with Report Painter.

WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.' );

Said differently - I would like to make the prompt for the Company variable have all of the unique values of Company in the IRSUM table plus have an "all" option.

This message has been edited. Last edited by: Kerry,


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 03, 2008, 06:12 PM
Doug
Can you add 'ALL' to your IRSUM file? If so, just use some DM after the prompting to accomodate the 'ALL' as the associated value and code your logic handle it.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 06, 2008, 10:14 AM
JDroke
I can't add "all" since company number is numeric.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 06, 2008, 10:20 AM
nubi
im pretty sure ive done this before but not in painter- ill have a look at my recent reports to see if there is something you can just put in as code...


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
October 06, 2008, 02:43 PM
Doug
The fact that the field is numeric does not preclude the ability to add ALL as an option. This is available via HTML layout Painter.

Check out HTML Layout painter and The Launch Page. Please ignore the ugly pages. This is a purely academic exercise.

Am I missing something?
October 09, 2008, 01:48 PM
JDroke
Thanks for you reply Doug but as I said in my original post - I know you can do it in the HTML Layout Painter - my question is whether or not it can be done in the Report Painter.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 09, 2008, 02:06 PM
Darin Lee
So are you wanting this to happen autmatically using autoprompting based upon how you've set up your parameter? When setting up variable values and such, you can accomplish a lot of the task so it is handled automatically, but if you are wanting to do ANYTHING the least bit complex, this is NOT the place to do it. It should all be handled through an HTML launch page.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
October 09, 2008, 04:20 PM
Doug
Yes JDroke, It can be done in the Report Painter. Here's the result. I added the -DEFAULT and compressed the PRINT fieldlist to one line.

-DEFAULT &COUNTRY = 'FOC_NONE' ;
TABLE FILE CAR
PRINT COUNTRY MODEL CAR DEALER_COST RETAIL_COST SALES
WHERE ( COUNTRY IN FILE CARLIST ) AND ( COUNTRY EQ '&COUNTRY' );
ON TABLE NOTOTAL
END

Would this do the trick? Or, do you want something else?

You can, also, use 'ALL' or some other value as the DEFAULT and do some DM logic to circumvent the WHERE statement which obviates it.

-DEFAULT &COUNTRY = 'ALL' ;
-SET &Bypass = IF &COUNTRY.EVAL EQ 'ALL' THEN '-*' ELSE '' ;
...
&Bypass.EVAL WHERE ( COUNTRY IN FILE COUNTRIES );
...

While at Chubb Insurance (NJ), we called this LSL (Leo's Smart Logic). It's self modifying code
October 14, 2008, 03:53 PM
Kerry
Hi JDroke,

To answer your question of whether the function can be done in Report Painter, the answer is NO, as report painter isn’t geared for that. You should really use HTML Layout Painter.

Thanks for Doug, Darin, and everyone's help on this one. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
October 24, 2008, 11:52 AM
JDroke
My intent was to allow the user to select *all values without having to use the HTML painter. I got around this by simply checking the parameter for blanks in the procedure and, if it was blank, I changed it to FOC_NONE which accomplished what I was trying to do.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 27, 2008, 11:47 AM
Darin Lee
That works too. Good Job! Many of the issues with parameters can be resolved by doing appropriate evaluation and handling of the parameter values that are passed - sometimes redefining them as jdroke has done.

I am still a strong proponent of creating HTML launch pages as opposed to letting autopromting do its thing. Creating an HTML launch page is NOT that complicated of a process and can resolve probably all issues similar to those the jdroke ran into.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
October 27, 2008, 12:04 PM
Tony A
Darin,

Whilst autoprompting has it's uses and benefits, it still can't cope with date variables and so no calendar controls only textual inputs.

Knowing what end users are like - if they have to start typing then they are not going to be happy Wink which is why there is a need for launch pages occasionally even when using amper autoprompting.

To circumvent this disadvantage (no calendar control) I have a launch page which acts exactly like the amper autoprompt but it does have calendar controls. The end users know no different and continue happy in their ignorance of the difference.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 10, 2012, 10:08 AM
Don Garland
quote:
-DEFAULT &COUNTRY = 'FOC_NONE' ;
TABLE FILE CAR
PRINT COUNTRY MODEL CAR DEALER_COST RETAIL_COST SALES
WHERE ( COUNTRY IN FILE CARLIST ) AND ( COUNTRY EQ '&COUNTRY' );
ON TABLE NOTOTAL
END


This is what I think Doug was talking about Smiler

-DEFAULT &COUNTRY = 'ALL' ;
-SET &COUNTRY = IF TRUNCATE(&COUNTRY) EQ 'FOC_NONE' OR 'ALL' OR '' THEN FOC_NONE ELSE &COUNTRY;
TABLE FILE CAR
PRINT COUNTRY MODEL CAR DEALER_COST RETAIL_COST SALES
WHERE ( COUNTRY EQ '&COUNTRY' );
ON TABLE NOTOTAL
END



WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL