Focal Point
Display 2 fields in a Multi-Select List Box

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

May 12, 2009, 04:02 PM
Rick Man
Display 2 fields in a Multi-Select List Box
First, I tried to populate the List Box from the file created in Step1 of the fex, but that didn't work. I had to create a seperate fex and then use it in the HTML Layout Painter. So if there is a way to do that that would be nice to know.

Second, my fex creates 2 fields, class and title. How can I display both of them in the drop down list and use the class number in the WHERE clause.

fex 1:
DEFINE FILE SCBCRSE
CRSE_MAX_KEY/A9 = SCBCRSE_SUBJ_CODE | SCBCRSE_CRSE_NUMB;
END
TABLE FILE SCBCRSE
PRINT *
CRSE_MAX_KEY
BY SCBCRSE_SUBJ_CODE
BY SCBCRSE_CRSE_NUMB
BY HIGHEST 1 SCBCRSE_EFF_TERM
WHERE SCBCRSE_SUBJ_CODE = 'GRDE'
-* Save as a FOCUS database with index
ON TABLE HOLD AS SCBCRSE_MAX_TERM FORMAT FOCUS INDEX CRSE_MAX_KEY
END
TABLE FILE SCBCRSE_MAX_TERM
PRINT
CRSE_MAX_KEY AS 'CLASS'
SCBCRSE_TITLE AS 'TITLE'
BY CRSE_MAX_KEY NOPRINT
BY SCBCRSE_TITLE NOPRINT
ON TABLE PCHOLD FORMAT XML AS GRDECRSE
END


fex2:
SET BYDISPLAY=ON
SET ASNAMES=ON
-*
DEFINE FILE AS_STUDENT_REGISTRATION_DETAIL
CLASS/A9 = SUBJ_CODE | COURSE_NUMBER;
END
TABLE FILE AS_STUDENT_REGISTRATION_DETAIL
PRINT
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.CLASS'
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.FIRST_NAME'
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.ID'
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.SUBJ_CODE'
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.COURSE_NUMBER'
     'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.SECTION_NUMBER'
BY 'AS_STUDENT_REGISTRATION_DETAIL.AS_STUDENT_REGISTRATION_DETAIL.LAST_NAME'
IF RECORDLIMIT EQ 100
WHERE TERM_CODE_KEY EQ '&TERMCODE';
WHERE MAJR_CODE1 EQ 'GRDE';
WHERE CLASS EQ &CLASS.(OR(ACCEPT CLASS FROM GRDECRSE)).CLASS.;
ON TABLE NOTOTAL
END



Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
May 12, 2009, 05:11 PM
GinnyJakes
Q1. You have to create a separate fex. Don't give the XML file an AS name.

Q2. I'm not sure that I understand. In order for both to show, you'd have to concatenate them together for both the display field and the value field. You'd then have to decompose them in the report fex.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
May 13, 2009, 10:57 AM
Rick Man
Thanks. I changed the Where clause in Report Painter to be Dynamic List rather than Accept List from File (This uses the ACCEPT feature of the MFD, per yours and other posts out there). So that then created this WHERE clause:
 WHERE CLASS EQ &CLASS.(OR(FIND CLASS IN GRDECRSE)).CLASS.; 

Then for the List Box in Composer I say Dynamic from Procedure and point to the fex that creates the xml file. And some how that all works. You are right I had to concatenate the course code to the title to display. That's OK. Using an AS phrase doesn't seem to matter. What I'm struggling with and can not find in the documentation or on FOCAL Point is how does the WHERE clause work? How does it know?

I had to edit the WHERE clause to point to the GRDECRSE file. Even with that if I run the fex without the Composer front end I get a FOC205 error, can not find the file. That would be true because there is no MFD for it. I could create a dummy one but that doesn't seem worthwhile.
Oh it's a Multi-select list box control.

If you could point me to where I can learn this stuff that would be great.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF