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     saving PDF report to disk

Read-Only Read-Only Topic
Go
Search
Notify
Tools
saving PDF report to disk
 Login/Join
 
Silver Member
posted
I am saving a report as pdf to disk. I added code so there will be an even number of pages using this code. If it is an odd number pages things work great but my issue is if it is an even number of pages how do I get the file to close without another page being created.

-IF IMOD(&FOCNEXTPAGE -1 ,2,'I5') EQ 0 GOTO OVER1;
TABLE FILE FINAL
BY TEMPHEAD NOPRINT
HEADING
" Blank Page "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS 'BJKPDF' FORMAT &formtype1 CLOSE
END
-RUN
-OVER1


Product WF 7.1.6 Windows
Database Oracle
outputs PDF, HTML, EXCEL
 
Posts: 37 | Registered: April 13, 2007Report This Post
Expert
posted Hide Post
Please enlighten us. Why are you concerned whether or not there's an even/uneven number of pages in a PDF document?

Can you duplicate this using the CAR file (or another one of IB's sample files?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Silver Member
posted Hide Post
Ok I am creating Webfocus reports and appending about 10 reports together to send to our printshop. We print duplex to save paper so I need a blank page at the end of an odd page report so we don't put say a department meat on the back of a produce report. Like I said if I have an odd page report I use the code that was provided and that puts a extra page at the end making it an even number of pages.
But if I have an even number page I can't seem to close the report that is build so far. I am doing this because this will save that department about 15 hrs a week in scanning documents and do all this by hand.

I haven't tried to duplicate it with the car file


Product WF 7.1.6 Windows
Database Oracle
outputs PDF, HTML, EXCEL
 
Posts: 37 | Registered: April 13, 2007Report This Post
Expert
posted Hide Post
Well put. Thanks for your explanation. We'd have to us a file which is larger then the CAR file to demo this. But, I do see your very valid point here. I’ll try to look into that.

First thought is to track the pages, as you have and branch around an EMPTYREPORT as per your branching logic. Perhaps you can print a "This page was intentionally left blank (positive feedback) report instead of an EMPTYREPORT. You'd have to know before hand (perhaps &LINES to a HOLD file) how many lines / pages you have before you determine whether or not to CLOSE or NOBREAK your initial report.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Some ideas for you to consider:

http://forums.informationbuild...=952107554#952107554

http://forums.informationbuild...341013271#9341013271



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
The key to a solution to this is to know how many page willoduced, so you can add a page when needed. If you cannot work out if you need an extra page, then here is a possibility.

A technique that we use here for a complex report, is to get the number of pages by checking the PDF document after its created. Then if its the wrong number of pages add a blank page to the produced document.

The command used is a unix command, but can be done from windows as well.

[CODE]grep /Count myfile.pdf > grep_count.ftm/CODE]

The file grep_count.ftm will contain the number of pages in the file. e.g. if the document has 20 pages, the file will contain "/Count 20".

We then use PDFBOX to append a blank page depending on the result.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Good One Waz...

In WebFOCUS, you can use a loop of 2 to determine howmany pages (&LINES / LPP) and work with the result. The loop also sets the hold file as when counter = 1 then HOLD else PCHOLD it also sets the CLOSE of BREAK. Then brach around a PDFBOX (blank PDF report). It's "tricky" but doable.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Silver Member
posted Hide Post
For now I am using the following code.

This checks for even number of pages
-IF IMOD(&FOCNEXTPAGE -1 ,2,'I5') EQ 0 GOTO OVER1;

This code is what adds a page if odd number of pages in report.
TABLE FILE FINAL
BY TEMPHEAD NOPRINT
HEADING
" Blank Page MI102g"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS 'BJKPDF' FORMAT &formtype1 CLOSE
END
-RUN
-GOTO DODEPT1


-OVER1
This code with force the close on even number of pages but I have put "REMOVE THIS PAGE"
so printshop can remove this page before printing.
For them to remove this will be 30 secs rather than 15 hours.
Can't force the close without printing something

TABLE FILE FINAL
BY TEMPHEAD NOPRINT
HEADING
"REMOVE THIS PAGE"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS 'BJKPDF' FORMAT &formtype1 CLOSE
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
FONT='ARIAL',
SIZE=28,
STYLE=BOLD,
$
ENDSTYLE
END
-RUN


Product WF 7.1.6 Windows
Database Oracle
outputs PDF, HTML, EXCEL
 
Posts: 37 | Registered: April 13, 2007Report 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     saving PDF report to disk

Copyright © 1996-2020 Information Builders