I have a compound report that prints multiple header and detail reports in a loop. Example
Header Report 1 Detail Report 1
Header Report 2
Header Report 3 Detail Report 3
Each header report should start a new page followed by the detail report on the same page. However, not every header report has a corresponding detail report (e.g. Header Report 2 above). I tried to do SET COMPOUND=OPEN and then use the NOBREAK keyword with the header report. That did not work. What the NOBREAK keyword does is to suppress the page break after the current report is done. In the case of Header Report 2, Header Report 3 prints on the same page as Header Report 2. Is there a way to specify a page break before printing a report?This message has been edited. Last edited by: Kerry,
WebFocus 7.6.8 OS 400 Output: PDF
May 11, 2009, 02:20 PM
GinnyJakes
Have you tried the Document Composer aka PDF Layout Painter, compound report?
How about generating a dummy detail report if there isn't one?
I want to see if there is a keyword that can tell WebFocus to do a page-break BEFORE printing the report. As far as the PDF Layout Painter, I have not used it to generate compound report. Will it tell me what keyword to use and where?
WebFocus 7.6.8 OS 400 Output: PDF
May 11, 2009, 04:51 PM
GinnyJakes
Why don't you check out the documentation for it and see? I have created a compound bursted report with a report and graph but there was no situation where I didn't have the graph.
The compound reporting syntax is quite easy and, by contrast, quite well documented. It's more flexible than the older style compound reporting (and then some) and will easily cope with what you require.
Search it out and get reading, there is no better way.
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
May 12, 2009, 07:30 AM
<JG>
All you have to do is add SET EMPTYREPORT=ON
May 12, 2009, 08:35 AM
David Ho
I did read the documentation titled "Creating a Compound Report". Here is a link to it.
The problem is these only address simple situations. Let me restate the problem I am facing. The compound report has a header report and a details report. Each header must start on a new page. The user can choose not to print the detail report. If the detail report is selected to print, it needs to follow the header report on the same page. It is also possible that there is no detail report for a certain header report. Sounds simple enough. The compound report syntax is
SET COMPOUND= {OPEN|CLOSE} [NOBREAK]
The NOBREAK allows me to control whether to do a page break after the current report is printed. I like to be able to say "Always start the current report on a new page". How can I do this in Web Focus. Can this be done at all?
WebFocus 7.6.8 OS 400 Output: PDF
May 12, 2009, 08:47 AM
<JG>
quote:
NOBREAK Is an optional phrase that suppresses page breaks. By default, each report is displayed on a separate page.
You have to read all the documentation
You need to have your code look like
SET EMPTYREPORT = ON SET COMPOUND=OPEN -loop endloop however many times TABLE FILE whatever SUM OBJECT BY VERB1 WHERE whatever ON TABLE PCHOLD FORMAT PDF NOBREAK END -SET &CLOSE = test if last iteration then 'SET COMPOUND CLOSE' ELSE ''; &CLOSE.EVAL -RUN TABLE FILE whatever Print OBJECT BY VERB1 BY VERB2 WHERE whatever ON TABLE PCHOLD FORMAT PDF END -endloop
May 12, 2009, 09:38 AM
Tony A
... or using the new syntax (again easily read and extrapolated from the more than adequate documentation) -
SET HTMLARCHIVE = ON
-*SET LAYOUTGRID = ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
-* Currently only one section can be employed
SECTION=section1, LAYOUT=ON, MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=A4, $
PAGELAYOUT=1, NAME='Layout page 1', BOTTOMMARGIN=0.5, TOPMARGIN=0.5, $
COMPONENT='header', TEXT='Header', POSITION=(0.417 0.417), DIMENSION=(7.167 1.885), $
-IF &Detail NE 'Y' THEN :Lab1;
COMPONENT='detail', TEXT='Detail', POSITION=(0.417 2.417), DIMENSION=(7.167 8.885), $
-:Lab1
PAGELAYOUT=2, NAME='Layout page 2', BOTTOMMARGIN=0.5, TOPMARGIN=0.5, $
COMPONENT='main_report', TEXT='Main Report', POSITION=(0.417 0.417), DIMENSION=(7.167 0.885), $
END
-*
SET COMPONENT='header'
-INCLUDE Header_Rep.fex
-IF &Detail NE 'Y' THEN :Lab2;
SET COMPONENT='detail'
-INCLUDE Detail_Rep.fex
-:Lab2
SET COMPONENT='main_report'
-INCLUDE Main_Rep.fex
-*
COMPOUND END
How easy can it be?
TThis message has been edited. Last edited by: Tony A,
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
May 12, 2009, 10:11 AM
David Ho
I know what you are saying. There are ways to do it. Like I said before, the questions is how simple is the solution.
By the way, the user can choose not to print the detail report. The problem is I cannot skip the detail report because that is what is doing the CLOSE and page break. I need to put some logic to always make it an empty report.
It would be nice to be able to say
SET COMPOUND=OPEN -loop through all the headers Always print header report on a new page if detail report is selected print detail report with no page break end if end loop close output
That is all I am trying to say.
WebFocus 7.6.8 OS 400 Output: PDF
May 12, 2009, 10:14 AM
David Ho
I did not get a chance to read Tony A. reply. I was composing my response. Let me read it first.
WebFocus 7.6.8 OS 400 Output: PDF
May 12, 2009, 10:17 AM
David Ho
Tony A. Can you post a link to the documentation of the new syntax. Thank you
WebFocus 7.6.8 OS 400 Output: PDF
May 12, 2009, 12:06 PM
Tony A
David,
Click on the "Search the Technical Documentation Library" link, top right.
In the left hand side of the form you are presented with, type "Document composer" (no quotes of course ) in the "Search For" input box. Choose WebFOCUS Reporting from the Select a Product and choose a release. Click on the awful yellow GO button and you will get about 46 responses. They will cover the GUI and also other useful references.
Good luck
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
May 12, 2009, 01:38 PM
David Ho
Tony,
Thank you for the info. I will look into it. Here is a question for you. Cut and paste the code below into a new fex file. It came from the document below (mostly). Did yo get a message like "Could not find a font in the Resource..." Now remove the NOBREAK from the second Report and run it again. You get a report output. Why?
TABLE FILE CAR PRINT CAR BY COUNTRY ON TABLE PCHOLD FORMAT PDF END
TABLE FILE CAR PRINT RCOST DCOST SALES BY COUNTRY ON TABLE PCHOLD FORMAT PDF NOBREAK END
TABLE FILE CAR PRINT CAR AS '' BY COUNTRY AS '' WHERE COUNTRY EQ 'GARBAGE' ON TABLE PCHOLD FORMAT PDF CLOSE NOBREAK ON TABLE SET EMPTYREPORT ON END
WebFocus 7.6.8 OS 400 Output: PDF
May 12, 2009, 03:15 PM
Darin Lee
The method you reference for creating compound reports, while still functioning, is not the current way to create compound documents. What Tony is saying is that the problem you are having would be a non-issue if you were to use the newer syntax. Compound documents with coordinated reports and such make this process a whole lot simpler than tyring to manage page breaks with OPEN/CLOSE/NOBREAK syntax.
Since you are on a version that supports this syntax, I would suggest that as a solution. The layout tool manages the syntax, of which Tony has given you an example.
I noticed in the 7.6.9. SNF document that the new version now properly handles paging when data elements are missing (which may be the problem.) Check it out in the documentation library.
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
May 12, 2009, 03:46 PM
j.gross
Dialog manager, conditional code values: ON TABLE PCHOLD FORMAT PDF &BREAK where &BREAK may be blank or NOBREAK or CLOSE as appropriate.
When the user requests header and detail, use a preliminary TABLE ... SAVE or HOLD (before running the header report) to determine whether that iteration of the loop will produce a detail report. Then specify &BREAK= ' ' for the header report if there are details to report, &BREAK=NOBREAK otherwise.
If the user suppresses all detail report, skip the preliminary TABLE, and use &BREAK= ' ' for all iterations.
Using JG's outine,
-loop endloop however many times
-IF &DETAILS? EQ 'NO' GOTO BREAK;
TABLE FILE whatever COUNT ... WHERE ... ON TABLE SAVE END -RUN -IF &RECORDS EQ 0 GOTO BREAK ELSE GOTO NOBREAK; (one of several ways to sense need for a detail report)
-BREAK -SET &BREAK = ' '; -GOTO HEADER
-NOBREAK -SET &BREAK = 'NOBREAK'; -HEADER
TABLE FILE whatever SUM OBJECT BY VERB1 WHERE whatever ON TABLE PCHOLD FORMAT PDF &BREAK END . . . -endloop
You'll have to ensure there's a CLOSE at the appropriate point (either in the final detail; or in the last Header if it has no detail; ; or in a trailer report (wasting one page) after the loop is ended.
- Jack Gross WF through 8.1.05
May 12, 2009, 04:27 PM
David Ho
j.gross,
Thank you for your reply. I know how to do all that. I just did not like the solution. All that logic that is required. Like I said in one of my reply, I was looking for ways to do the following. I did not include details (which is not important) but you should get the idea. All that "OPEN, CLOSE, NOBREAK, last iteration, and Does the header have details" goes away. It makes the code simple and easy to read and maintain.
I am reading up on the Document Composer (thanks to Tony). From what I have read so far, it appears that is the way to go.
SET COMPOUND=OPEN -loop through all the headers one at a time Always print header report on a new page if detail report is selected print detail report with no page break end if end loop close output