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     CONDITIONAL HEADER DISPLAY

Read-Only Read-Only Topic
Go
Search
Notify
Tools
CONDITIONAL HEADER DISPLAY
 Login/Join
 
Gold member
posted
Hi All,
I want to control the display of report header based on the contents of the column.

Please see below sample code am trying to deal with.

DEFINE FILE CAR
TEST1/A10 MISSING ON =IF COUNTRY EQ 'ENGLAND' THEN ' ' ELSE COUNTRY;
END
TABLE FILE CAR
PRINT
CAR
SEAT
TEST1
BY COUNTRY
ON TABLE HOLD AS HOLD1
END
-RUN
TABLE FILE HOLD1
PRINT
CAR
SEAT
BY COUNTRY
ON COUNTRY PAGE-BREAK
HEADING
"TEST rEPORT"
"-IF TEST1 EQ ' ' THEN GOTO NODISPLAY;
"-NODISPLAY
ON TABLE SET ONLINE-FMT PDF
END

But there is a blank space appered in the second line in place of TEST1 while country eq 'england'.

Is there any way to hide or display the Heading?


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
 
Posts: 71 | Registered: November 20, 2003Report This Post
Virtuoso
posted Hide Post
Kasi

First of all I would like you to ask to change your signature, so we know what version and platform you are using.

What you are trying to do is mixing the command levels, and that is not how this works.

If you want in this case different headings based on the value of the country, you have to create these headings in the define (that is what you did) but then put that defined field in the heading.
Something like

DEFINE FILE CAR
TEST1/A10 MISSING ON =IF COUNTRY EQ 'ENGLAND' THEN '' ELSE COUNTRY;
END
TABLE FILE CAR
PRINT
CAR
SEAT
BY COUNTRY
ON COUNTRY PAGE-BREAK
HEADING
"<TEST1"
ON TABLE SET ONLINE-FMT PDF
END




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, 2006Report This Post
Gold member
posted Hide Post
Hi Frank,
Thanks for the help. Your below example displays a blank line in the header if Country = England. I want to suppress that whole line in case if the TEST1 field is empty.

I have used CAR file for example. But I have six fields contain information to be displayed in the header. I want to hide/suppress the lines in case the field value is MISSING or blank.
Please let me know if anyone has any idea.


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
 
Posts: 71 | Registered: November 20, 2003Report This Post
Virtuoso
posted Hide Post
i don't hink you can do that with a header as they are tied to the page, not the fields. You could probably use a subheading and get the result you are looking for.


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, 2007Report This Post
Expert
posted Hide Post
If you are displaying data columns in a heading, then I will assume one summary record per report?????

DEFINE FILE FILENAME
COL1/FORMAT = IF COLUMN1 EQ ' ' THEN '??????'(ALPHA) OR 000000(NUMERIC) ELSE COLUMN1;
COL2/FORMAT = IF COLUMN2 EQ ' ' THEN '??????' OR 000000 ELSE COLUMN2;
COL3/FORMAT = IF COLUMN3 EQ ' ' THEN '??????' OR 000000 ELSE COLUMN3;
COL4/FORMAT = IF COLUMN4 EQ ' ' THEN '??????' OR 000000 ELSE COLUMN4;
COL5/FORMAT = IF COLUMN5 EQ ' ' THEN '??????' OR 000000 ELSE COLUMN5;
COL6/FORMAT = IF COLUMN6 EQ ' ' THEN '??????' OR 000000 ELSE COLUMN6;
END

TABLE FILE FILENAME
SUM
COL1
COL2
COL3
COL4
COL5
COL6
BY SORT_COLUMN
ON TABLE SAVE
END
-RUN

-READ SAVE &SORT.Axx/Ixx &COL1.Axx/Ixx &COL2.Axx/Ixx &COL3.Axx or Ixx &COL4.Axx/Ixx &COL5.Axx/Ixx &COL6.Axx/Ixx

IF YOUR HEADING DISPLAYS EACH COLUMN ON A SEPARATE LINE SKIP THIS PART...

-SET &ACOL1 = IF COL1 EQ '??????' THEN ' ' ELSE ' Column1: ' | &COL1;
-SET &ACOL2 = IF COL2 EQ '??????' THEN ' ' ELSE ' Column2: ' | &COL2;
-SET &ACOL3 = IF COL3 EQ '??????' THEN ' ' ELSE ' Column3: ' | &COL3;
-SET &ACOL4 = IF COL4 EQ '??????' THEN ' ' ELSE ' Column4: ' | &COL4;
-SET &ACOL5 = IF COL5 EQ '??????' THEN ' ' ELSE ' Column5: ' | &COL5;
-SET &ACOL6 = IF COL6 EQ '??????' THEN ' ' ELSE ' Column6: ' | &COL6;

TABLE FILE XFILE
HEADING
"&ACOL1 &ACOL2 &ACOL3 &ACOL4 &ACOL5 &ACOL6"
PRINT/SUM...


or

for each line:

TABLE FILE XFILE
HEADING
-IF &COL1 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO CK_COL2;
"Column1: &COL1"
-CK_COL2
-IF &COL2 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO CK_COL3;
"Column2: &COL2"
-CK_COL3
-IF &COL3 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO CK_COL4;
"Column3: &COL3"
-CK_COL4
-IF &COL4 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO CK_COL5;
"Column4: &COL4"
-CK_COL5
-IF &COL5 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO CK_COL6;
"Column5: &COL5"
-CK_COL6
-IF &COL6 EQ '??????'(for ALPHA) 00000(for INTEGER) GOTO SKIPPY;
"Column6: &COL6"
-SKIPPY

PRINT/SUM...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Thanks Tom and Darin.

Tom,
I tried working with your example. But it is not giving me desired results.
TABLE FILE CAR
PRINT
COUNTRY/A8
CAR/A10
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &CNTRY1.A8.
TABLE FILE HOLD1
PRINT
CAR
BY
COUNTRY
ON COUNTRY PAGE-BREAK
HEADING
"&CNTRY1"
END

In the above example, England is displayed for all the countries.

Frank's example is very close to my rquirement except that the column values are displayed in the same line instead of consecutive lines. So only thing I need is that some variable to include a new line character between two columns so that they will be displayed in two lines in the header.

Like below.

DEFINE FILE FILE1
HEADER_TEXT/A100 = IF COLUMN2 NE ' ' THEN COLUMN1 || NEWLINE_CHARACTER || COLUMN2 ELSE COLUMN1;
END
TABLE FILE FILE1
PRINT
COL3
COL4
COL5
HEADING
"ON TABLE SET ONLINE-FMT PDF
END

Please share your thoughts.


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
 
Posts: 71 | Registered: November 20, 2003Report This Post
Gold member
posted Hide Post
Apologies,
In the above example it should read as
"<head_text"
on table set online-fmt pdf


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
 
Posts: 71 | Registered: November 20, 2003Report This Post
Expert
posted Hide Post
Again, I qualified my response with:

quote:
If you are displaying data columns in a heading, then I will assume one summary record per report????


If you use PRINT, as you are doing, then you have to create a loop based on your BY values; your code should be as follows:

TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-SET &XLINES = &LINES;
-SET &CNTR = 0;
-REPEAT LOOP_CNTRY &XLINES TIMES
-SET &CNTR = &CNTR + 1;
-SET &OPEN_CLOSE = IF &CNTR EQ 1 THEN 'OPEN' ELSE
- IF &CNTR EQ &XLINES THEN 'CLOSE' ELSE ' ';
-READ HOLD1 &CNTRY1.A8.
-********************************************
TABLE FILE CAR
PRINT
CAR
BY COUNTRY
WHERE COUNTRY EQ '&CNTRY1';
HEADING CENTER
"&CNTRY1"
ON TABLE PCHOLD FORMAT PDF &OPEN_CLOSE
END
-LOOP_CNTRY
-EXIT


Please look at the code....


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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     CONDITIONAL HEADER DISPLAY

Copyright © 1996-2020 Information Builders