IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    DevStudio multiselect combobox to select column from a table
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Platinum Member
Posted
How can I select colums from a table so that those are the mutiselect items in a combobox?

Example:
I am trying to PRINT columns COUNTRY, CAR, D_COST and MODEL from CAR table. I want the combobox to be filled with all the column name from CAR table i.e. COUNTRY, CAR, D_COST, R_COST, MODEL, etc... The user should be able to select 1 or more colums from the combobox and depending on the selection, x amount of colums should appear on the report.


WF 7.6.x and 7.1.x Win/Solaris/AIX, MRE/Dashboard/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, JD Edwards
 
Posts: 173 | Location: Irving, TX | Registered: June 27, 2006Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
If you are using HTML painter, create a focexec:
CHECK FILE filename HOLD
TABLE FILE HOLD
BY FIELDNAME
ON TABLE PCHOLD FORMAT XML
END

and attach that to a multi-select.

Then create a report using the parameters (field names) passed from the multi-select.

The same type of request can be run for self service also, but using the methods often quoted in FP for creating your list box.


Alan.
WF 7.6.5, PMF 5.1, MRE,RA,RG, etc... Win2003(8xQuad)/IIS/Tomcat with SSL and AD security.
 
Posts: 848 | Location: Portugal | Registered: February 07, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Simple but smart solution Alan....

I will keep this in mind.




Frank

prod: WF 7.6.5 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.5 on the same platform and databases,IE7

 
Posts: 1644 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Thank you Alan. That did allow me to populate my list box with field names. Now how do I multi select those field names and generate colums on my report based on my selection?

This is the approach I am taking:
1) form- create html file that points to fex1 to dynamically populate the column title. then have a submit button that will submit the values to fex2.

2) fex1- is where hold the fieldname as you suggested

3) fex2- is where I am planning to display fields according to my selection from my form.

I am failing to see how I would create fex2 so that the values from the form can be submitted and appropriate columns show up on the report.


WF 7.6.x and 7.1.x Win/Solaris/AIX, MRE/Dashboard/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, JD Edwards
 
Posts: 173 | Location: Irving, TX | Registered: June 27, 2006Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Okey, this seems to work unless you only select 1 value or ALL option. Code needs to be changed for those.

-TYPE &FIELDS

-* Remove OR from the &FIELDS
-SET &FIELDS_LENGTH = &FIELDS.LENGTH;
-SET &FIELDS1 = STRREP (&FIELDS_LENGTH, &FIELDS, 6, ''' OR ''', 2, ' @', &FIELDS_LENGTH, 'A&FIELDS_LENGTH.EVAL');
-SET &FIELDS2 = STRIP(&FIELDS_LENGTH, &FIELDS1, '@', 'A&FIELDS_LENGTH.EVAL');
-SET &FIELDS3 = STRIP(&FIELDS_LENGTH, &FIELDS2, '''', 'A&FIELDS_LENGTH.EVAL');

-TYPE &FIELDS1
-TYPE &FIELDS2
-TYPE &FIELDS3


TABLE FILE CAR
PRINT &FIELDS3.EVAL
END


WF 7.6.x and 7.1.x Win/Solaris/AIX, MRE/Dashboard/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, JD Edwards
 
Posts: 173 | Location: Irving, TX | Registered: June 27, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    DevStudio multiselect combobox to select column from a table

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.