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 FILE1 COMPUTE CH1 = 'CH1' AS '' COMPUTE CH2 = 'CH2' AS '' COMPUTE CH3 = 'CH3' AS '' OVER FIELD1 AS '' FIELD2 AS '' FIELD3 AS '' OVER FIELD4 AS '' FIELD5 AS '' FIELD6 AS '' END
Problem with this is, it will print column titles for every record. Also, If I want to have subheads, they will appear above column titles.
1.Is there any better way of doing this other than using HEADING command and try to align the column headings with the printed column data ?
2.How to do styling of this kind of report ? My requirement is to color the rows that start with A1 with a color, color the rows that start with A4 with a different color etc ?
Just to make myself more clear, I have a file with 100 columns where I need to print each row into 5 lines(with 10 columns each) and styling each of them differently.
I don't know about an efficient way, but there does seem to be a convoluted answer to you first question.
This is a three step process. I'm assuming you want your report sorted by SORTFIELD, but if you don't care about sort order, then you should be able to combine the first two steps.
The first steps assigns a line number to every line on your report, after sorting.
TABLE FILE FILE1 PRINT FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6 COMPUTE LINENUM/I5 = LINENUM + 1; BY SORTFIELD ON TABLE HOLD AS HOLD1 END
The second step is going to create an artificial page counter. In the IMOD statement, substitute for 50 the number of lines you want on each page. We are not actually going to print the page number on the report, but we are going to use it to tell the report when to pagebreak.
DEFINE FILE HOLD1 REMAINDER/I3 = IMOD(LINENUM,50,'I3'); PAGECOUNT/I3 = IF REMAINDER EQ 0 THEN PAGECOUNT + 1 ELSE PAGECOUNT; END
TABLE FILE HOLD PRINT * PAGECOUNT REMAINDER ON TABLE HOLD AS HOLD2 END
The third step creates 3 fields that hacontain blank except for the first line of each page, in which case they contain your column titles.
TABLE FILE HOLD2 PRINT COMPUTE CH1/A3 = IF LINENUM EQ 1 THEN 'CH1' ELSE IF PAGECOUNT EQ LAST PAGECOUNT THEN ' ' ELSE 'CH1'; AS '' COMPUTE CH2/A3 = IF LINENUM EQ 1 THEN 'CH1' ELSE IF PAGECOUNT EQ LAST PAGECOUNT THEN ' ' ELSE 'CH2'; AS '' COMPUTE CH3/A3 = IF LINENUM EQ 1 THEN 'CH1' ELSE IF PAGECOUNT EQ LAST PAGECOUNT THEN ' ' ELSE 'CH3'; AS '' OVER FIELD1 AS '' FIELD2 AS '' FIELD3 AS '' OVER FIELD4 AS '' FIELD5 AS '' FIELD6 AS ''
BY PAGECOUNT NOPRINT PAGE-BREAK END
You'll probably have to play with column alignments, but I think this will work, as long as you don't set the number of lines on your page (second IMOD parameter in step 2) too high or too low.
Not sure about your second question yet. I'll think on that, if someone else doesn't get you an answer soon.
dwf
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005
thanks dwf for your input. I see your point. In my case, I want to keep the headings just once at the beginning of the report. I guess my only way is using the HEADING command and aligning it with the data.
Sorry, amrav. I did not realize you wanted the column titles only on page 1. HEADING should work fine. You could also do this, though I don't particularly think it's any better than HEADING.
DEFINE FILE FILE1 CH1/A3 = 'CH1'; CH2/A3 = 'CH2'; CH3/A3 = 'CH3'; END TABLE FILE FILE1 PRINT CH1 AS '' CH2 AS '' CH3 AS '' OVER FIELD1 AS '' FIELD2 AS '' FIELD3 AS '' OVER FIELD4 AS '' FIELD5 AS '' FIELD6 AS '' END