Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Help with column headings when using "OVER".

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Help with column headings when using "OVER".
 Login/Join
 
Member
posted
Gurus,

I am trying to find the efficient way of doing this.

Lets say, I have a file with data like this in 2 rows.


A1 A2 A3 A4 A5 A6
B1 B2 B3 B4 B5 B6

I want to print a report like this:

"CH1" "CH2" "CH3" <-- Column Headings.
A1 A2 A3
A4 A5 A6
B1 B2 B3
B4 B5 B6
B1 B2 B3
B4 B5 B6

I have tried the following:

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.

Thanks in advance.


USA
 
Posts: 8 | Registered: November 14, 2005Report This Post
Platinum Member
posted Hide Post
amrav,

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, 2005Report This Post
Member
posted Hide Post
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.


USA
 
Posts: 8 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
Try using SET LINES=9999 to see if that does what you want.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
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

As for color, something like

TYPE=DATA, COLUMN=FIELD1, COLOR=BLUE, $
TYPE=DATA, COLUMN=FIELD2, COLOR=BLUE, $
TYPE=DATA, COLUMN=FIELD3, COLOR=BLUE, $
TYPE=DATA, COLUMN=FIELD4, COLOR=RED, $
TYPE=DATA, COLUMN=FIELD5, COLOR=RED, $
TYPE=DATA, COLUMN=FIELD6, COLOR=RED, $

etc

That's a lot of stylesheet statements, though. YOu might be able to devise some dialogue manager loops to handle that, but it would be ugly, I think.


dwf
 
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005Report This Post
Platinum Member
posted Hide Post
amrav:

1. "headings just once at the beginning of the report". I think ON TABLE SUBHEAD is a good option.

2. About the style, may be DEFMACRO helps to organize your styling needs in this report.

Example:

TABLE FILE CAR
  PRINT
    COUNTRY  AS ''
    MODEL    AS ''
    RCOST    AS ''
   OVER
    CAR      AS ''
    BODYTYPE AS ''
    DCOST    AS ''
  ON TABLE SUBHEAD 
    "CH1<+0>CH2<+0>CH3"
  ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF, $
    TYPE=TABHEADING, HEADALIGN=BODY, BACKCOLOR=SILVER, STYLE=BOLD, $
    DEFMACRO=A1, COLOR=RED, WHEN=COUNTRY EQ 'ENGLAND', $
    DEFMACRO=A2, COLOR=BLUE, WHEN=COUNTRY EQ 'JAPAN', $
    TYPE=DATA, COLUMN=P1, MACRO=A1, $
    TYPE=DATA, COLUMN=P2, MACRO=A1, $
    TYPE=DATA, COLUMN=P3, MACRO=A1, $
    TYPE=DATA, COLUMN=P1, MACRO=A2, $
    TYPE=DATA, COLUMN=P2, MACRO=A2, $
    TYPE=DATA, COLUMN=P3, MACRO=A2, $
    TYPE=DATA, COLUMN=P4, MACRO=A2, $
    TYPE=DATA, COLUMN=P5, MACRO=A2, $
    TYPE=DATA, COLUMN=P6, MACRO=A2, $
  ENDSTYLE
END

Hope this helps.
Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Member
posted Hide Post
Thanks all for the help.
I am going to go by the ON TABLE SUBHEAD route as Mikel suggested.

Now I am on the hunt for techniques to position the heading elements.

I found a few links by searching but none of them work.

Can somebody tell me how can I look up these threads ?

http://forum.informationbuilders.com/cgi-bin/ultimatebb...;f=2;t=000524#000000

http://forum.informationbuilders.com/cgi-bin/ultimatebb...;f=2;t=000340#000003


http://forum.informationbuilders.com/cgi-bin/ultimatebb...;f=2;t=000237#000001


http://forum.informationbuilders.com/cgi-bin/ultimatebb...;f=2;t=000544#000003


Thanks again.


USA
 
Posts: 8 | Registered: November 14, 2005Report This Post
Member
posted Hide Post
I meant positioning the heading elements in HTML format.

Thanks.


USA
 
Posts: 8 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
Hi USA,

Here are the updated links for those topics.

Heading alignment

How to align Subtotals in Subfoot with the column

Subhead/subfoot

spot markers and alignment for subfoot....

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Help with column headings when using "OVER".

Copyright © 1996-2020 Information Builders