Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Changing the display of a multiple selection parameter in the report heading

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Changing the display of a multiple selection parameter in the report heading
 Login/Join
 
Guru
posted
I am working on a launch page that runs a report for multiple states. I would like to display whatever states were selection from the list box at the time the report was run from the launch page. Currently, the report is set up to display the state parameter in the heading. If I were to run the report for the states of FL, AR, AL and GA, the heading would display like the following. The listbox is set up to allow multiple state selection that is coded in the fex with a multiple WHERE clause. Does anybody have a suggestion on how I can make the multiple states that appear in the report heading more presentable? Thanks.

States: 'AL' OR 'AR' OR 'FL' OR 'GA'

This message has been edited. Last edited by: <Emily McAllister>,


WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Guru
posted Hide Post
I do this with some of my passed values to display on the report output. This replaces the OR with commas. I also pass these values back into a query to do a lookup for meaningful values, ie the actual state name if you have a lookup table.

If not you could use a decode to display the staten ame.

 

-SET &StateAbrevLength   = &StateAbrev.LENGTH;
-SET &StateAbrevAdj      = IF &StateAbrev CONTAINS ' OR ' THEN STRREP (&StateAbrev.LENGTH, &StateAbrev, 3, ' OR ', 1, ',', &StateAbrev.LENGTH, 'A&StateAbrevLength.EVAL') ELSE &StateAbrev;
 


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Guru
posted Hide Post
Superb! Thank you MattC. Your suggestion is fantastic. It worked well. I know I can't get rid of the apostrophe marks surrounding each state because it is a reserved WF symbol, but the comma in place of the OR statements looks great! Thanks again for a terrific suggestion.


WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Expert
posted Hide Post
quote:

I know I can't get rid of the apostrophe marks surrounding each state because it is a reserved WF symbol

Not true, the manual shows how to remove "any" character:
 
-SET &StateAbrevLength   = &StateAbrev.LENGTH;
-SET &StateAbrevAdj      = IF &StateAbrev CONTAINS ' OR ' THEN STRREP (&StateAbrev.LENGTH, &StateAbrev, 3, ' OR ', 1, ',', &StateAbrev.LENGTH, 'A&StateAbrevLength.EVAL') ELSE &StateAbrev;
-SET &StateAbrevAdj      = IF &StateAbrevadj CONTAINS ''''THEN STRREP (&StateAbrevadj.LENGTH, &StateAbrevadj, 1, '''', 0, 'x', &StateAbrevadj.LENGTH, 'A&StateAbrevadj.LENGTH.EVAL') ELSE &StateAbrevadj;


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
Tom, I'm getting the following error when I use your suggestion. Can you tell me what I'm doing wrong? I replaced the &StateAbrev.LENGTH with &JURIS_ST.LENGTH which is the name of the state parameter that the HTML page uses. Thanks.
 

-SET &StateAbrevLength   = 20;

-SET &StateAbrevAdj      = IF 'AR' OR 'FL' OR 'GA' CONTAINS ' OR ' THEN STRREP (20, 'AR' OR 'FL' OR 'GA', 3, ' OR ', 1, ',', 20, 'A20') ELSE 'AR' OR 'FL' OR 'GA';

-SET &StateAbrevAdj      = IF 'AR' OR 'FL' OR 'GA' CONTAINS ''''THEN STRREP (20, 'AR' OR 'FL' OR 'GA', 1, '''', 0, 'x', 20, 'A0.EVAL') ELSE 'AR', 'FL', 'GA'    ;

 0 ERROR AT OR NEAR LINE     99  IN PROCEDURE
 prod_app/pf_p0009_new_referral.fexFOCEXEC *
 (FOC266) IF .. THEN .. ELSE .. SYNTAX ERROR



 


WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Expert
posted Hide Post
space after the CONTAINS ''''THEN
s/b CONTAINS '''' THEN


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
Tom, I need your help one more time. I still can't get your code to work. I can get the first code set to work, but can't get the second code set to work. Thanks.

  
First Code Set
-SET &JURIS_STLength   = &JURIS_ST.LENGTH;

-SET &JURIS_STADJ      = IF &JURIS_ST CONTAINS ' OR ' THEN STRREP (&JURIS_ST.LENGTH, &JURIS_ST, 3, ' OR ', 1, ',', &JURIS_ST.LENGTH, 'A&JURIS_STLength.EVAL') ELSE &JURIS_ST;

Results
Claim Jurisdiction: 'AR', 'DE', 'FL'

Second Set
-SET &JURIS_STLength   = &JURIS_ST.LENGTH;

-SET &JURIS_STADJ      = IF &JURIS_ST CONTAINS ' OR ' THEN STRREP (&JURIS_ST.LENGTH, &JURIS_ST, 3, ' OR ', 1, ',', &JURIS_ST.LENGTH, 'A&JURIS_STLength.EVAL') ELSE &JURIS_ST;

-SET &JURIS_STADJ      = IF &JURIS_STADJ CONTAINS '''' THEN STRREP (&JURIS_STADJ.LENGTH, &JURIS_STADJ, 1, '''', 0, 'x', &JURIS_STADJ.LENGTH, 'A&JURIS_STADJ.LENGTH.EVAL') ELSE &JURIS_STADJ;






WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Expert
posted Hide Post
Hi Michele,
This is in PROD in WebFOCUS 8.0.09 and works in QA, 8.1.04, we strip the quotes 1st, then. the OR; just change the amperes to yours:
  
-SET &QT = '''';
-SET &ADDRTYPX  = IF &ADDRTYP1 CONTAINS '''' THEN STRREP(&ADDRTYP1.LENGTH, &ADDRTYP1, 1, &QT, 0, 'X', &ADDRTYP1.LENGTH, 'A&ADDRTYP1.LENGTH')  ELSE &ADDRTYP1;
-TYPE &ADDRTYPX
-IF &ADDRTYPX OMITS ' OR ' GOTO SKIP_STRIPX;
-SET &ADDRTYPX  = STRREP(&ADDRTYPX.LENGTH, &ADDRTYPX, 4, ' OR ', 1, ',', &ADDRTYPX.LENGTH, 'A&ADDRTYPX.LENGTH');
-TYPE &ADDRTYPX
-SKIP_STRIPX


Really don't need this:
-SET &JURIS_STLength = &JURIS_ST.LENGTH;
Just use &VAR_NAME.LENGTH

BTW, space OR space is 4 bytes, not 3 as in your code, fyi...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
...and here is the real solution nobody knows...


Just check the checkbox "send display value". ( in properties of the HTML control ).

If the original parameter is &STATE it will create another parameter &STATE_TEXT

If &STATE is 'CA' OR 'DE' OR 'FL'
&STATE_TEXT will be 'CA','DE','FL'

Only thing you have to do is add
-DEFAULTH &STATE_TEXT = '';

to prevent prompting for this parameter and prevent HTML from creating a control for it the next time you reload the fex.

G'luck.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Guru
posted Hide Post
Thank you MattC, Tom and Dave for the excellent feedback. The states display just the way I want them to in the report heading. I will definitely save the code for future use.

Dave, I'm not quite sure I understand your suggestion since I'm able to display the states in the report heading by just using &JURIS_ST which is the state parameter that was already set up in the HTML page. I'm working with an HTML page that was created by someone else. He created a listbox that displays the states. It is a Dynamic Embedded procedure binded to the parameter &JURIS_ST. I'd appreciate more feedback.

A million thanks. Your suggestions made my day.


WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Expert
posted Hide Post
Dave is 100% correct.
quote:
&STATE_TEXT
Each Control in HTML Composer has a checkbox to "Send display value". For multi-select listboxes, report-heading-friendly text is sent in a variable named *_TEXT.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
All of our parameters have the Send Display Value checked, but, we use them as filters for the report.
Yes, when we converted from 7 to 8, and, IBI started prompting for these & variables that the application creates, we had to -DEFAULT all of them.
Yes, they can go into a header, but, we create a Parameters tab so all of our Excel reports are compound and are utilized as real workbooks.
PDF reports are where we use them in Headings, if needed...

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
This is neat stuff. If I'm understanding correctly, I have two options for displaying/filtering multi-selected states.

Choice 1
1) Create a -DEFAULT parameter for the state (&JURIS_ST)
2) Add a multiple state WHERE clause in the filter section of the fex as follows
WHERE tablename.tablename.JURIS_STATE EQ &JURIS_ST.(OR(FIND tablename.tablename.JURIS_STATE IN tablename)).JURIS_STATE.;
3) Add the -SET parameters that uses the STRREP function so that the states display nicely in the report heading
4) Add the state parameter in the HEADING section of the report so that the states will display


Choice 2 (eliminates the multiple WHERE clause)
1) Create a -DEFAULT parameter for the state (&JURIS_ST)
2) Create a -DEFAULTH &JURIS_ST_TEXT parameter
3) Add the -SET parameters that uses the STRREP function so that the states display nicely in the report heading
4) Add the state parameter in the HEADING section of the report so that the states will display
5) Click the Send Display Value checkbox on the Properties menu for the state listbox


Is this correct?


WF 8205, Windows 10
Oracle DBMS
EXL07/PDF Output
 
Posts: 244 | Registered: August 27, 2012Report This Post
Master
posted Hide Post
update choice 2

Step 1 is not needed, unless you actually have default for the end-user.

Step 3 is not needed

Step 4 : Add &JURIS_ST_TEXT instead of &JURIS_ST

and you're done.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Guru
posted Hide Post
Your welcome.


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Changing the display of a multiple selection parameter in the report heading

Copyright © 1996-2020 Information Builders