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 using the heading to create a one job report of basic job information. My problem is I have variables that could have data or it could not have data. How do I suppress the blank lines so the report looks dynamic?
Example: DEFINE FILE JOBINFOALL NAMEST1/A200 = IF NMSQTY1 EQ 0 THEN 'No namestamp lists have been received.' ELSE ('A list was received on '| NM1DATEA | 'with a quantity of ' | NMSQTY1T | 'in color ' | NMSCLD1); NAMEST2/A200 = IF NMSQTY2 EQ 0 THEN '' ELSE ('A list was received on '| NM2DATEA | 'with a quantity of ' | NMSQTY2T | 'in color ' | NMSCLD2); NAMEST3/A200 = IF NMSQTY3 EQ 0 THEN '' ELSE ('A list was received on '| NM3DATEA | 'with a quantity of ' | NMSQTY3T | 'in color ' | NMSCLD3); NAMEST4/A200 = IF NMSQTY4 EQ 0 THEN '' ELSE ('There are more than 3 name stamp lists submitted with a total quantity of '| NMSQTY4T); END TABLE FILE JOBINFOALL HEADING "Namestamp:" """""End of report"
I don't want NAMEST2, NAMEST3 or NAMEST4 to show up on this report. This is the output I get.
Namestamp: A list was received on 2 /1 /2008 with a quantity of 76 in color Bright Gold
gregv's approach works. But if you have many heading lines and each line might or might not be wanted...
I think that if you truly want the info in the heading and you do not want to ever see a blank line in the header then you need to use ampers. This can get complicated if you have many pages etc. But the logic would be to stick the entire heading line in an amper like this... -SET &HEAD1=IF SOMETHING THEN '"HEADING LINE 1"' ELSE ''; TABLE FILE CAR SUM SALES HEADING &HEAD1 END
So first hold the data.. then read the data and set ampers and then build the heading ampers. If you have many pages of data and the heading will be different on each page then it can still be done inside a loop.
DEFINE FILE JOBINFOALL
NAMEST1/A200 = IF NMSQTY1 EQ 0 THEN 'No namestamp lists have been received.' ELSE ('A list was received on '| NM1DATEA | 'with a quantity of ' | NMSQTY1T | 'in color ' | NMSCLD1);
NAMEST2/A200 = IF NMSQTY2 EQ 0 THEN '' ELSE ('A list was received on '| NM2DATEA | 'with a quantity of ' | NMSQTY2T | 'in color ' | NMSCLD2);
NAMEST3/A200 = IF NMSQTY3 EQ 0 THEN '' ELSE ('A list was received on '| NM3DATEA | 'with a quantity of ' | NMSQTY3T | 'in color ' | NMSCLD3);
NAMEST4/A200 = IF NMSQTY4 EQ 0 THEN '' ELSE ('There are more than 3 name stamp lists submitted with a total quantity of '| NMSQTY4T);
END
TABLE FILE JOBINFOALL
HEADING
"Namestamp:"
"<NAMEST1"
"<NAMEST2"
"<NAMEST3"
"<NAMEST4"
"End of report"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
That is the code. My profile is correct. The output format is to the screen. I did not copy all of the formatting because that is fine, I just need help on the formatting of the one line that I don't want shown on the screen. In other words, I don't want blank lines showing on the screen in place of a data line. I want that line to go away! Like a FOC_NONE on a where clause.This message has been edited. Last edited by: JennyM,
This becomes a little tricky, (but not impossible as Jodye states) when the headings are dependent on field values because you can't reference fields when setting &vars.
My suggestion would be to try something like the following. My example uses a simple heading, but I think it would be "doable" with something more complex as well. The technique is to concatenate everything into a single line and then use WRAP in the stylesheet to force it to move to the next line at the appropriate place. This way, you only get as many lines as you need.
DEFINE FILE CAR
HEADLINE1/A25='THIS IS HEADING LINE 1 ';
HEADLINE2/A25='THIS IS HEADING LINE 2 ';
HEADLINE3/A25='THIS IS HEADING LINE 3 ';
HEADLINE4/A25='THIS IS HEADING LINE 4 ';
ALLHEADLINE/A75=HEADLINE1|HEADLINE2|HEADLINE3;
-*ALLHEADLINE/A100=HEADLINE1|HEADLINE2|HEADLINE3|HEADLINE4;
END
TABLE FILE CAR
SUM
CAR
BY COUNTRY
HEADING
"<ALLHEADLINE "
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING, LINE=1, WRAP=1.8,$
ENDSTYLE
END
Regarles of whether you use the length 75 heading or the length100 heading, it looks correct.This message has been edited. Last edited by: Darin Lee,
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, 2007
WOO HOOO!!!! thanks so much. That worked great! EXACTLY WHAT I NEEDED!!!! The end result is here!
DEFINE FILE JOBINFOALL
NAMEST1/A200 = IF NMSQTY1 EQ 0 THEN 'No namestamp lists have been received.' ELSE ('A list was received on '| NM1DATEA | 'with a quantity of ' | NMSQTY1T | 'in color ' | NMSCLD1);
NAMEST2/A200 = IF NMSQTY2 EQ 0 THEN '' ELSE ('A list was received on '| NM2DATEA | 'with a quantity of ' | NMSQTY2T | 'in color ' | NMSCLD2);
NAMEST3/A200 = IF NMSQTY3 EQ 0 THEN '' ELSE ('A list was received on '| NM3DATEA | 'with a quantity of ' | NMSQTY3T | 'in color ' | NMSCLD3);
NAMEST4/A200 = IF NMSQTY4 EQ 0 THEN '' ELSE ('There are more than 3 name stamp lists submitted with a total quantity of '| NMSQTY4T);
ALLNAMEST/A510 = NAMEST1|NAMEST2|NAMEST3|NAMEST4;
END
TABLE FILE JOBINFOALL
HEADING
"Namestamp:"
"<ALLNAMEST"
"End of report"
-*
and it shows on the screen like this!
Namestamp:
A list was received on 2 /1 /2008 with a quantity of 76 in color Bright Gold
End of report
This message has been edited. Last edited by: JennyM,
but if you use WRAP= or WIDTH= (width doesn't work for PDF, but is does for HTML) in the stylesheet for the HEADING and get the correct width, it LOOKS like it's on multiple lines, and only uses as many lines as necessary. Looks like this
PAGE 1 THIS IS HEADING LINE 1 THIS IS HEADING LINE 2 THIS IS HEADING LINE 3 COUNTRY CAR ENGLAND TRIUMPH FRANCE PEUGEOT ITALY MASERATI JAPAN TOYOTA W GERMANY BMW
or
PAGE 1 THIS IS HEADING LINE 1 THIS IS HEADING LINE 2 THIS IS HEADING LINE 3 THIS IS HEADING LINE 4 COUNTRY CAR ENGLAND TRIUMPH FRANCE PEUGEOT ITALY MASERATI JAPAN TOYOTA W GERMANY BMW
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, 2007
That would be fine if that was all I am showing in the report, HOWEVER, I have many lines (50 so far)of heading lines displaying different job specs of differing lengths per line. IE some lines may have 14 characters, other lines may have 150 characters. I don't want to limit the overall style to wrap at a certain length to accommodate this piece when other pieces need more length to look "pretty". This is live look at the data.
Total Pages: 160
Printed Pages: 160
Blank Pages: 0
Total Pages Submitted: 115 / completing 6 flats on 02/25/2008
Your requested delivery date is on or before 05/22/2008
Copies: 350
Mounting: Yearbook Cnct Disk Submit
Trim Size: 8 1/2 X 11
Binding: Smyth Sewn Hard Cover
Round and Back: RB
Proof Type: CD Proofs
Paper Stock: LEGEND GLOSS 80 #
Optional Items:
Autograph Supplement: Quantity of 37 size 08 Autograph Supp./Ship with book
Plastic Book Protector/Cover: Quantity of 35 size 08
Year in Review: Quantity of 63 size 08 Cust Tip/YR IN REVIEW Mini-Mag
CE Buzz: Not Ordered
UV Coating: You have not submitted any pages requesting UV Coating.
Cover Specs:
Your cover was received on 10/22/2007
Stock: PRINTED HARD COVER on 120 PT ESKA BOARD
Proofs: Digital Proof
Your cover will contain: (LIST OUT PROCESSES STILL IN PROGRESS)
Namestamp:
A list was received on 2/1/2008 with a quantity of 76 in color Bright Gold
iTag:
A list was received on 2/1/2008 with a quantity of 106 in color Silver w/ Black Lettering
Endsheet Specs:
Your endsheet was received on 10/22/2007
Stock: Front stock is STANDARD WHITE ENDLEAF Back stock is STANDARD WHITE ENDLEAF
Proofs: Digital Proof
Your cover will contain: (LIST OUT PROCESSES STILL IN PROGRESS)
Okay. so forget about the wrap. Since this is HTML display only, just throw in some HTML tags and it still looks right.
DEFINE FILE CAR
HEADLINE1/A25='THIS 1 ';
HEADLINE2/A25='THIS IS 2 ';
HEADLINE3/A25='THIS IS HEADING 3 ';
HEADLINE4/A25='THIS IS HEADING LINE 4 ';
-*ALLHEADLINE/A75=HEADLINE1|HEADLINE2|HEADLINE3;
ALLHEADLINE/A112=HEADLINE1|'<BR>'|HEADLINE2|'<BR>'|HEADLINE3|'<BR>'|HEADLINE4;
END
you get
PAGE 1
THIS 1 THIS IS 2 THIS IS HEADING 3 THIS IS HEADING LINE 4
COUNTRY CAR ENGLAND TRIUMPH FRANCE PEUGEOT ITALY MASERATI JAPAN TOYOTA W GERMANY BMW
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, 2007
Entirely different question. you could use a fixed font and make sure spaces were embedded properly and the WRAP= would still work.
I don't know if there is a way to insert an escape character or string into a PDF doc to force a line break.
Ideas, anyone?
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, 2007
Just as I posted that, something clicked in the back of my head to remind me that I had seen this somewhere before so I searched the forum for line break and found the following technique, modified for use by heading:
DEFINE FILE CAR
HEADLINE1/A25='THIS 1 ';
HEADLINE2/A25='THIS IS 2 ';
HEADLINE3/A25='THIS IS HEADING 3 ';
HEADLINE4/A25='THIS IS HEADING LINE 4 ';
ALLHEADLINE/A106=HEADLINE1|'; '|HEADLINE2|'; '|HEADLINE3|'; '|HEADLINE4;
NEWHEADLINE/A106 = CTRAN(106, ALLHEADLINE, 059, 013, NEWHEADLINE);
END
TABLE FILE CAR
SUM
CAR
BY COUNTRY
HEADING
"<NEWHEADLINE "
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='COURIER',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=REPORT,LINEBREAK='CR',$
ENDSTYLE
END
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, 2007
marker is an HTML tag so it would ONLY be valid when the report is displayed in HTML format. Any other format, as Jenny discovered, would not work correctly. The above code using the LINEBREAK='CR' will work correctly for a PDF doc, but not for HTML. So take your pick.
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, 2007
still gives you the extra 3 lines. You have to set that concatenation line up in stages.... IE
DEFINE FILE JOBINFOALL
NAMEST1/A125 = IF NMSQTY1 EQ 0 THEN 'No namestamp lists have been received.' ELSE ('A list was received on '| NM1DATEA | 'with a quantity of ' | NMSQTY1T | 'in color ' | NMSCLD1);
NAMEST2/A125 = IF NMSQTY2 EQ 0 THEN '' ELSE ('A list was received on '| NM2DATEA | 'with a quantity of ' | NMSQTY2T | 'in color ' | NMSCLD2);
NAMEST3/A125 = IF NMSQTY3 EQ 0 THEN '' ELSE ('A list was received on '| NM3DATEA | 'with a quantity of ' | NMSQTY3T | 'in color ' | NMSCLD3);
NAMEST4/A125 = IF NMSQTY4 EQ 0 THEN '' ELSE ('There are more than 3 name stamp lists submitted with a total quantity of '| NMSQTY4T);
ALLNAMEST/A600 = IF NMSQTY4 NE 0 THEN NAMEST1|'<BR>'|NAMEST2|'<BR>'|NAMEST3|'<BR>'|NAMEST4 ELSE IF NMSQTY3 NE 0 THEN NAMEST1|'<BR>'|NAMEST2|'<BR>'|NAMEST3 ELSE IF NMSQTY2 NE 0 THEN NAMEST1|'<BR>'|NAMEST2 ELSE NAMEST1;
-*
END
TABLE FILE JOBINFOALL
HEADING
"Namestamp:"
"<ALLNAMEST"
""
"End of report."
END
and it gives you the following report
Namestamp:
A list was received on 2/1/2008 with a quantity of 76 in color Bright Gold
End of report.
I made the modifications and it works nicely. Just remember that if your 2nd, 3rd, and 4th lines are blank, you have to rebuild the concatenation line based on those properties. In my example, you can assume there will be some sort of data in line 1 because if it is null, you are putting
No namestamp lists have been received.
This message has been edited. Last edited by: JennyM,
In many cases, when people post code as a solution, the person with the problem runs it, finds that it is not quite what they need, and then they post again saying "That's not quite what I need. Now what do I do?" This is an excellent example of someone taking what they know and making it work for what they need. Good job Jen!!
Not to say that this is a no-no. Sometimes we just can't figure things out, especially if it's someone else's code. But seeing this example really let's you know that someone has been truly "helped." Teach a man to fish...
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, 2007
Jen, It might be easier to include the br tags in the seperate fields, and only if this fields is assigned a non-blank value. That way you won't have this complex if-statement for computing the all-field. This would look something like:
DEFINE FILE JOBINFOALL
NAMEST1/A125 = IF NMSQTY1 EQ 0 THEN 'No namestamp lists have been received.<br>'
ELSE ('A list was received on ' | NM1DATEA | 'with a quantity of ' |
NMSQTY1T | 'in color ' | NMSCLD1 | '<br>');
NAMEST2/A125 = IF NMSQTY2 EQ 0 THEN ''
ELSE ('A list was received on ' | NM2DATEA | 'with a quantity of ' |
NMSQTY2T | 'in color ' | NMSCLD2 | '<br>');
NAMEST3/A125 = IF NMSQTY3 EQ 0 THEN ''
ELSE ('A list was received on ' | NM3DATEA | 'with a quantity of ' |
NMSQTY3T | 'in color ' | NMSCLD3 | '<br>');
NAMEST4/A125 = IF NMSQTY4 EQ 0 THEN ''
ELSE ('There are more than 3 name stamp lists submitted with a total quantity of '| NMSQTY4T | '<br>');
ALLNAMEST/A600 = NAMEST1 | NAMEST2 | NAMEST3 | NAMEST4;
END
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007