Focal Point
Compound PDFs to start with Page 1

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5071068331

June 07, 2005, 01:00 PM
Carol Dobson
Compound PDFs to start with Page 1
Hi everyone!
I have a user who wants to compound several reports but doesn't want the consecutive page numbering. She wants each report in the compound document to start with page 1. I've tried using tabpageno and focfirstpage independently, but it doesn't seem to work. Now you're asking then why compound the report? She needs the output all in one file. We are using WebFOCUS release 5.2.4
Any ideas?

Thanks and have a great day,
Carol
June 07, 2005, 01:33 PM
mgrackin
Try setting &FOCNEXTPAGE = 1 before each additional report to be added to the PDF.
June 07, 2005, 03:11 PM
Carol Dobson
Hi Mickey,
Still can't get it right, here's the simplified code..... I've tried it with a SET and a -SET

APP PREPENDPATH CARTST
-SET &FOCFIRSTPAGE = 1 ;
-RUN
TABLE FILE CAR
SUM COUNTRY
BY COUNTRY
ON TABLE PCHOLD FORMAT PDF OPEN
HEADING CENTER
"REPORT NUMBER 1"
END
-SET &FOCFIRSTPAGE = 1 ;
-RUN
TABLE FILE CAR
SUM MODEL
BY MODEL
ON TABLE PCHOLD FORMAT PDF
HEADING CENTER
"REPORT NUMBER 2"
END
-SET &FOCFIRSTPAGE = 1 ;
-RUN
TABLE FILE CAR
PRINT COUNTRY MODEL
ON TABLE PCHOLD FORMAT PDF CLOSE
HEADING CENTER
"REPORT NUMBER 3"
END

Thanks!
Carol
June 07, 2005, 05:36 PM
reFOCUSing
Give this a try:

SET FOCFIRSTPAGE = 1
SET COMPOUND = OPEN
TABLE FILE CAR
HEADING
"PRINT COUNTRY
ON TABLE PCHOLD FORMAT PDF
END
-RUN
SET FOCFIRSTPAGE = &FOCNEXTPAGE


TABLE FILE CAR
HEADING
"PRINT CAR
ON TABLE PCHOLD FORMAT PDF
END
-RUN

SET COMPOUND = CLOSE
SET FOCFIRSTPAGE = &FOCNEXTPAGE
TABLE FILE CAR
HEADING
"PRINT MODEL
ON TABLE PCHOLD FORMAT PDF
END
-RUN

This message has been edited. Last edited by: <Maryellen>,
June 08, 2005, 12:02 PM
Carol Dobson
Oh shucks, I got excited there for a moment, but it still gave me page 1, 2 and 3 and I need page 1, 1 and 1

Thank you CurtisA. I'm wondering if it's the release that we're on WF 5.2.4

Thanks again!
Carol
August 16, 2005, 03:07 PM
reFOCUSing
Carol,
Where you able to create a workaround for this? I have ran into the same problem now. Do you know if a workaround was created in WF 7?
August 18, 2005, 06:23 PM
Carol Dobson
Hi reFOCUSing,
I have not found a workaround for this problem and we are living with it for now since it's not a show stopper. I'm not sure if it's fixed in WF7, but will test that soon as I can. We have WF7 living on a standalone server and I'm going to be testing. I'll be happy to post my results.

Thanks,
Carol
August 18, 2005, 06:52 PM
Francis Mariani
SET FOCFIRSTPAGE = 1

in between compound PDF reports does not appear to work in 5.3.4 - the page numbers are sequential.
August 18, 2005, 07:43 PM
reFOCUSing
I have WF 7 running and it is not fixed in that environment.

I have put a case in with IBI and I will post a workaround if one is given.
August 18, 2005, 08:04 PM
Carol Dobson
Thanks for trying it in WF7, you're saving me time! I would love a solution if anyone comes up with a workaround.

Thanks again!
August 18, 2005, 08:32 PM
Francis Mariani
The workaround! The trick is to manipulate the page number. It's important that the HEADING is after the COMPUTE REP_PAGE.


-SET &ECHO=ALL;

USE
C:\ibi\apps\Samples\CENTORD.FOC
END
-RUN

SET PAGE-NUM=OFF
SET ORIENTATION=LANDSCAPE
-RUN

-*-- Report 1 --------------------------

SET COMPOUND = OPEN
-RUN

TABLE FILE CENTORD
SUM LINEPRICE
BY PLANT
BY PRODCAT
HEADING
"Sales Report "
"Page<TABPAGENO"
" "
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Sales', $
TYPE=HEADING, STYLE=BOLD, COLOR=BLUE, $
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
-RUN

-*-- Report 2 --------------------------

TABLE FILE CENTORD
SUM QUANTITY
COMPUTE REP_PAGE/I4 = TABPAGENO - &FOCNEXTPAGE + 1; NOPRINT
BY PLANT
BY PRODCAT
HEADING
"Inventory Report 1"
"Page<REP_PAGE"
" "
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Inventory 1', $
TYPE=HEADING, STYLE=BOLD, COLOR=RED, $
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
-RUN

-*-- Report 3 --------------------------

TABLE FILE CENTORD
SUM QUANTITY
COMPUTE REP_PAGE/I4 = TABPAGENO - &FOCNEXTPAGE + 1; NOPRINT
BY PLANT
BY PROD_NUM
HEADING
"Inventory Report 2"
"Page<REP_PAGE"
" "
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Inventory 2', $
TYPE=HEADING, STYLE=BOLD, COLOR=ORANGE, $
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
-RUN

-*-- Report 4 --------------------------

SET COMPOUND = CLOSE
-RUN

TABLE FILE CENTORD
SUM LINE_COGS
COMPUTE REP_PAGE/I4 = TABPAGENO - &FOCNEXTPAGE + 1; NOPRINT
BY PLANT
BY PRODCAT
HEADING
"Cost of Goods Sold Report"
"Page<REP_PAGE"
" "
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Cost of Goods Sold', $
TYPE=HEADING, STYLE=BOLD, COLOR=GREEN, $
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
-RUN
August 18, 2005, 10:14 PM
reFOCUSing
Francis,
Thanks for the workaround. I modified your code a little and figured I would share.

Since our reports could be in any order (don't know which is the first report). I added the COMPUTE of REP_PAGE to every report (with some changes) and then changed the HEADING to not use TABPAGENO.

Here are my changes:
-* REP_PAGE was changed to this for all reports.
COMPUTE REP_PAGE/I4 = IF &FOCNEXTPAGE EQ 0 THEN TABPAGENO ELSE TABPAGENO - &FOCNEXTPAGE + 1; NOPRINT

-* HEADING was changed to this for all reports.
"Page<REP_PAGE of <TABLASTPAGE"
August 19, 2005, 05:34 PM
Carol Dobson
Thanks a million Francis and reFOCUSing, you guys really are Guru's!!!

Carol
September 06, 2005, 08:24 PM
reFOCUSing
Figured I would share this. When doing some searching on TABLASTPAGE I came across this case. Which uses REPAGE to workaround this problem for PDF. What's great is this solution will work for EXL2K, HTML and PDF with no custom coding. I'm sooo glad techsupport was so quick in telling me there is no workaround, when a solution is on the IBI site. Confused


I cleaned the code up a bit:
-DEFAULT &WFFMT = PDF
DEFINE FILE CAR
BLANK/A1 = ' ';
END
-RUN
-*****************************
-* REPORT #1
-*****************************
TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
BY BLANK NOPRINT REPAGE
HEADING
"Page "THIS IS REPORT #1"
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT OPEN
END
-RUN
-*****************************
-* REPORT #2
-*****************************
TABLE FILE CAR
PRINT
STANDARD
BODYTYPE
BY BLANK NOPRINT REPAGE
HEADING
"Page "THIS IS REPORT #2 "
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT
END
-RUN
-*****************************
-* REPORT #3
-*****************************
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
BY BLANK NOPRINT REPAGE
HEADING
"Page "THIS IS REPORT #3 "
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT
END
-RUN
-*****************************
-* REPORT #4
-*****************************
TABLE FILE CAR
PRINT
COUNTRY
BY BLANK NOPRINT REPAGE
BY CAR
BY MODEL
ON CAR PAGE-BREAK
HEADING
"Page "THIS IS REPORT #4 "
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT CLOSE
END
-RUN

This message has been edited. Last edited by: <Maryellen>,
September 07, 2005, 04:34 PM
Carol Dobson
Thanks reFOCUSing, my user is very happy! Focal Point rules in getting answers, so many great developers out there and as always, many ways to do things in FOCUS.
November 08, 2010, 10:57 AM
Ted Michalski
how do I use page numbering in a specific text line in a compouond report?
The commpound report may vary in the number of pages.

Is there something I can put instead of "Page #1" literal in this heading? FOCNEXTPAGE and FOCFIRSTPAGE don't seem to work.

OBJECT=STRING, NAME='header1', TEXT='Page #1', POSITION=(6.8 1.09), MARKUP=ON, WRAP=ON, DIMENSION=(5.0 0.167), style=bold, METADATA='', $


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
November 08, 2010, 11:55 AM
GamP
quote:
OBJECT=STRING, NAME='header1', TEXT='Page #1', POSITION=(6.8 1.09), MARKUP=ON, WRAP=ON, DIMENSION=(5.0 0.167), style=bold, METADATA='', $

In stead of page #1, you can use
<ibi-page-number/>
.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 08, 2010, 12:04 PM
Ted Michalski
Thanks. Is there any way to get this number to start with a page number other than 1?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
November 08, 2010, 12:06 PM
Ted Michalski
Never mind. I see that it will increment the pages numbers based on the number of pages in the compound report.


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
November 09, 2010, 02:14 PM
Ted Michalski
Is there any way to use ibi-page-number in a Compound Report component instead of an OBJECT=STRING?

The reason I'm asking is that I want the pages to be numbered correctly in case of overflow page(s).


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
November 09, 2010, 04:33 PM
Francis Mariani
I wonder if this thread should win an award, 11,489 views in 5 years!

I apologize for not posting anything useful!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 10, 2010, 02:33 AM
GamP
I'm not totally sure, but I think this has to be in a string to get translated. I have put this in the master layout and as far as I know, it takes overflow pages into account if put in the master page. But it's been a while since I even looked at it, so I may be wrong.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988