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.
TABLE FILE CAR
BY COUNTRY NOPRINT AS ''
BY CAR AS ''
ON COUNTRY SUBHEAD
"---<+0><COUNTRY<+0>---"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
Ultimately I want to use this output to populate a listbox. I can't go directly to XML because I'll lose the subhead. Is there some format I can use to HOLD this output exactly as I want it and then output it to XML for my listbox?
Something like...
FILEDEF LSTHLD DISK test/LSTHLD.???
TABLE FILE CAR
BY COUNTRY NOPRINT AS ''
BY CAR AS ''
ON COUNTRY SUBHEAD
"---<+0><COUNTRY<+0>---"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS LSTHLD FORMAT ????????????
END
-RUN
TABLE FILE LSTHLD
PRINT *
ON TABLE PCHOLD FORMAT XML
END
I can't seem to find the right combination of the file extension in the FILEDEF statement and the format in the HOLD statement.
Thanks in advance for any help!
DanThis message has been edited. Last edited by: Dan Pinault,
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
How about creating the subhead (country names) as dummy CARs so you can mix them in the same XML file. You may need to give these dummy cars a special sequenze to hold it as the first row per country.
what are you going to use the drop down box for?
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
I'll go in the same direction as Frank. I might have a quicker answer by asking "What do you need as the contents/purpose of the list box?" Having a subheading in a list box isn't the norm. Usually contents of a list box are selectable values.
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Interesting idea Frank. I tried doing something like
IF (COUNTRY NE LAST COUNTRY)...
but then I lost the first CAR item in the list. I'll have to give the numbering concept some think-time.
The listbox will be on an ad-hoc reporting screen. We want to display a list of fieldnames in the listbox but have them 'grouped' together by the segment name in our business view. The actual code will look more like this...
CHECK FILE CAR HOLD AS CARHLD
TABLE FILE CARHLD
BY SEGNAME NOPRINT
BY FIELDNAME AS ''
ON SEGNAME SUBHEAD
"---<+0><SEGNAME<+0>---"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
I just thought it would be simpler to use the COUNTRY and CAR fields for the purpose of this thread.
Cheers!
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
Originally posted by Darin Lee: Having a subheading in a list box isn't the norm. Usually contents of a list box are selectable values.
I agree Darin but the powers-that-be really want to see the list of selection items 'grouped' in some fashion. If I can get the list to work as shown above then perhaps I'll just add some javascript to not allow selection of the items whose content is like '---%'.
Not sure how else to approach this. I'm open to alternatives if you have any suggestions.
Thanks,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
This has got to be a near the top of my "Ugliest Code" list, but I just couldn't figure out how to get the titles in with the values. Working backwards, the only way was to have them both in the same column, but then they have to be re-sorted in the appropriate order. So here's something with the CAR file. You'll have to adjust the code accordingly to make it into a list box.
-SET &ECHO=ALL;
SET HOLDLIST=PRINTONLY
-*get all the values and assign sort orders for correlation
DEFINE FILE CAR
COUNTER/I9 WITH COUNTRY=COUNTER + 1;
NCOUNTRY/A30='-----'|COUNTRY||'-----';
END
TABLE FILE CAR
PRINT COUNTRY
NCOUNTRY
CAR/A30
COUNTER
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE HOLD
END
-*get all the countries wit sort values
TABLE FILE HOLD
SUM NCOUNTRY
MAX.COUNTER
COMPUTE ORDER/I1=0;
COUNTRY
BY NCOUNTRY NOPRINT
ON TABLE HOLD AS HEADINGS FORMAT FOCUS
END
-*get all the cars with sort values
TABLE FILE HOLD
SUM CAR
MAX.COUNTER
COMPUTE ORDER/I1=1;
COUNTRY
BY NCOUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE HOLD AS DETAILS FORMAT FOCUS
END
-RUN
-*concatentate the hold files
USE
DETAILS.FOC AS DETAILS
HEADINGS.FOC AS DETAILS
END
-RUN
-*read as a single file and output in sort orders
TABLE FILE DETAILS
PRINT CAR
BY COUNTRY NOPRINT
BY COUNTER NOPRINT
BY ORDER NOPRINT
BY CAR NOPRINT
END
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
PRINT
COMPUTE OPTGROUP/A100 =
'<optgroup label="' || COUNTRY || '">'; NOPRINT
COMPUTE OPTVAL/A100 =
'<option value="' || CAR || '">' || CAR || '</option>'; NOPRINT
COMPUTE OPTION/A200 =
IF COUNTRY NE LAST COUNTRY THEN OPTGROUP || OPTVAL ELSE OPTVAL;
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE HOLD AS HLIST1
END
-RUN
-HTMLFORM BEGIN
<form>
<select>
!IBI.FIL.HLIST1;
</select>
</form>
-HTMLFORM END
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
I would stick with the old-fashioned (Francis) as opposed to the uninformed (me) speaking of the code and not the author, of course
Helps to know some more of the HTML tags. OPTGROUP would be the best/easiest way.
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
But if Dan really really needs xml output, here's a way to do that:
FILEDEF HOLDCAR DISK HOLDCAR.FTM (APPEND
TABLE FILE CAR
SUM COMPUTE CFIELD/A30 = '------' | COUNTRY || '------';
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLDCAR
END
TABLE FILE CAR
PRINT COMPUTE CFIELD/A30 = CAR;
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLDCAR
END
TABLE FILE HOLDCAR
PRINT CFIELD
BY COUNTRY NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Yes, I really need XML. I'm trying to stay within the confines of the HTML Composer and add the least amount of extra code possible. This is great! I can use this code within the existing WebFOCUS listbox control.
This has made my day
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007