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.
I am trying to display the number of lines on my report, but I am getting 0 when I use the &LINES parameter. I've been searching this forum for a while, and found nothing that works. What am I doing wrong? I am using Webfocus Developer Studio v. 7. I am using report painter to create this report.
TABLE FILE FORM
SUM
CNT.FORM_FUND_CODE AS 'ROWS'
PRINT
FORM_SSN
FORM_LAST_NAME AS 'LAST_NAME'
FORM_FIRST_NAME AS 'FIRST_NAME'
FORM_APPROVE_AMT/D12.2CM AS 'APPROVE_AMT'
FORM_SUB_DATE AS 'SUB_DATE'
FORM_APP_PHASE_CDE AS 'APP_PHASE_CDE'
FORM_LNST_CODE AS 'LNST_CODE'
FORM_EL_STATUS AS 'EL_STATUS'
FORM_FUND_CODE AS 'FUND_CODE'
ON TABLE SUBFOOT
"&LINES"
WHERE FORM_AIDY_CODE EQ '&AID_YEAR';
WHERE FORM_EL_STATUS EQ 'S';
WHERE NOT FORM_LNST_CODE IN ('DENY','CNCL','CANC');
WHERE FORM_FUND_CODE IN ('FSUBST', 'FUNSUB', 'FPLUSL');
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
YADAYADAYADA
END STYLE
END
Are you familiar with the internal matrix in focus reporting? When you use sum cnt..... by .... the cnt field is assigned a column name in the internal matrix. In this case C1 as JG posted contains a count of models after returning the internal matrix from the sort. As computes are always performed after sorting, the field now contains the line count so to speak. How you use the count is up to you in the report.
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
Your welcome, Brian, I've been using Focus/WebFocus for years and I still learn something new almost weekly.
And interesting comment Francis, I hardly ever use -RUN, it's a technique to be sure the internal stack is clear as I understand it by doing so may help the code to execute 'better'. Correct me if I'm wrong please and thank you.
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
Francis, I am not sure in practicality how to use your suggestion. I did put the -RUN after my end statement, however the &LINES (without the compute statement) still gives a 0.
I guess, what doesn't make sense to me, is that if you are putting a variable (amper or not) in the document Report Footer, then why wouldn't it wait to assign the Report Footer area once the report is complete. Kinda like a compute statement is done once the report is complete.
Brian, see JG's originally comment, &RECORDS, &LINES and so on, values are generated after a reporting step is run (after the END produces and output). Thus during the report execution, the value of the field is a zero. Also if your report did have zero lines without using SET EMPTYREPORT ON you wouldn't see any thing. With it on and there are no records only thing ususally displayed is the heading lines.
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
Yeah, I do get that. It makes sense that they would populate once the report is complete. I would just think that webfocus wouldn't do the report footer until the report completed. But, that's just my logic (which is probably immeasureably flawed).
The compute does work for me. Seems like extra work, but it does the job. Francis's idea sounds good, but I didn't get that to work. Adding the -RUN didn't work any miracles for me.
So, after talking with a focus developer on campus, my final code looks like this. It's very similar to what JG gave me ealier. And of course the Sum CNT has to be in this one.
TABLE FILE FORM
SUM
CNT.FORM_FUND_CODE NOPRINT
PRINT
FORM_SSN
FORM_LAST_NAME AS 'LAST_NAME'
FORM_FIRST_NAME AS 'FIRST_NAME'
FORM_APPROVE_AMT/D12.2CM AS 'APPROVE_AMT'
FORM_SUB_DATE AS 'SUB_DATE'
FORM_APP_PHASE_CDE AS 'APP_PHASE_CDE'
FORM_LNST_CODE AS 'LNST_CODE'
FORM_EL_STATUS AS 'EL_STATUS'
FORM_FUND_CODE AS 'FUND_CODE'
COMPUTE LINECNT/I5 = LINECNT + 1;
ON TABLE SUBFOOT
"ROWS RETURNED: <LINECNT"
WHERE FORM_AIDY_CODE EQ '&AID_YEAR';
WHERE FORM_EL_STATUS EQ 'S';
WHERE NOT FORM_LNST_CODE IN ('DENY','CNCL','CANC');
WHERE FORM_FUND_CODE IN ('FSUBST', 'FUNSUB', 'FPLUSL');
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
YADAYADAYADA
END STYLE
END
This message has been edited. Last edited by: funsutton,
They are assigned after the process and not during.
-RUN executes the stack and forces population of system variables and ALSO processes other commands such as FILEDEF.
The effect is dependant on the version of WebFocus you are using and in the latest releases -RUN is not so important, WebFocus seems to have become more intelligent.
For example Pre 71x
FILEDEF XX DISK xx.fex TABLE FILE CAR PRINT COMPUTE MODELQ/A26=''' | MODEL '''; WHERE COUNTRY EQ 'ENGLAND' ON TABLE SET HOLDLIST PRINTONLY ON TABLE SAVE END TABLE FILE CAR PRINT MODEL WHERE MODEL IN FILE SAVE END
WILL NOT WORK
While
FILEDEF XX DISK xx.fex -RUN TABLE FILE CAR PRINT COMPUTE MODELQ/A26=''' | MODEL '''; WHERE COUNTRY EQ 'ENGLAND' ON TABLE SET HOLDLIST PRINTONLY ON TABLE SAVE END -RUN TABLE FILE CAR PRINT MODEL WHERE MODEL IN FILE SAVE END