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.
Why is it that I can use variables from my data source in headings and footings but not as column titles? For example, this works: ON item1 SUBHEAD "Name: <item1" But this does not: PRINT item2 AS '<item1' -the column title comes out blank. I realize that if 'item1' was different in each record that would be a problem, but my SQL sets it to the same value in each record. Bottom line, I want to have a variable column title based on the data I retrieve. I can use a dialog variable to do this, but you can't set a dialog variable to a value from your retrieved data.
item1 is not a variable, it is a data column, either created through a DEFINE or contained in the file being reported on. You can embed data columns in headings but not in column titles.
You can set a Dialog Manager variable to a value in the retrieved data by -READing a HOLD or SAVE file. You may have to modify your program slightly. If you're using SQL to create a HOLD file and then report from it, simply -READ the HOLD file, to make life easier, make the Column Title data column the first one and then read the file:
Thanks. Our standard template consists of: SQL SQLMSS EX stored_proc_name TABLE FILE SQLOUT ON TABLE HOLD AS #temptable PRINT * END followed by DEFINE FILE #temptable to define some more fields using the retrieved data, and finally TABLE FILE #temptable to format the report.
Would I insert the -READ statement before or after the DEFINE FILE statement? Would the syntax be -READ HOLD01 or -READ #temptable01 ? I presume the desired data can be in any column besides 01 as long as the right number is appended to the hold file name? Will this in effect empty the hold file such that the data would have to be reinserted into the hold file before the TABLE FILE statement?
-READ will not empty the hold file. The file to -READ is #temptable (though I've not seen # in a hold file name before). Yes, the desired data could be in any column - I suggested the first one to make it less complicated to determine the correct number of characters to read. The -READ could be done before or after the DEFINE. Just make sure there's a -RUN before the -READ to ensure that the hold file gets created before the -READ is done.
The code would look something like this:
SQL SQLMSS EX stored_proc_name TABLE FILE SQLOUT ON TABLE HOLD AS #temptable FORMAT ALPHA PRINT * END -RUN
-READ #temptable &FILLER1.A104. &COLTITLE.A50.
DEFINE FILE #temptable ... END -RUN
TABLE FILE #temptable PRINT FIELD1 AS '&COLTITLE' ... END -RUN
I've made it a habit to stick a -RUN after every END statement.
You may have to change the format of the HOLD file to ALPHA to correctly calculate how many characters to skip before the Column Title column. Changing the format should have no effect on the report.
If you have a lot of columns in the hold file before the Column Title column, may I suggest you change the code slightly - just to make it easier to isolate the desired column:
SQL SQLMSS EX stored_proc_name TABLE FILE SQLOUT ON TABLE HOLD AS #temptable PRINT * END -RUN
TABLE FILE #temptable PRINT COLUMN_TITLE WHERE RECORDLIMIT EQ 1 ON TABLE HOLD AS HOLDTEMP FORMAT ALPHA END -RUN
-READ HOLDTEMP &COLTITLE.A50.
DEFINE FILE #temptable ... END -RUN
TABLE FILE #temptable PRINT FIELD1 AS '&COLTITLE' ... END -RUN
This message has been edited. Last edited by: <Maryellen>,
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