Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Feed only after Odd Page

Status
Not open for further replies.

wanman75

IS-IT--Management
Sep 11, 2002
7
US
Hi All...

I am trying to print duplex reports using PB 10.0. but can't figure out how to get the second "copy" to start on a fresh page.

Basically, I have a single report that contains a customer copy and a merchant copy. The printer is set to duplex print all documents that hit it (don't ask) so I have to be able to add an even page to the customer copy if it has an odd number of pages. This is so the first page of the merchant copy doesn't end up on the back of the last page of the customer copy.

Is there a good/accepted way to do this in PB?

Thanks.
 
I should probably have mentioned that I tried putting a computed field at the top of the report header with the formula
IF(report_for='MERCHANT' AND page()=1 AND mod(pageCount(),2)=1,'~f',string(page()))

I put the 'string(page())' in for testing to make sure that I was getting *something* there. On the first page of the Merchant copy though all I get is a blank box character, which I'm assuming is the form showing an unprintable character. All the other pages have the page number.

What am I doing wrong or not doing?

TIA.
 
Unfortunately it's not possible to change the application to do so, so I'm stuck with playing with the report that it calls. Basically the report dumps the data twice using two Groupings.

I put a computed field at the bottom of the page with the following formulas for controlling visibility, height, and width:
Visibility: IF(page()=pageCount() AND mod(pageCount(),2)=1, 1, 0)
Width: IF(page()=pageCount() AND mod(pageCount(),2)=1, 5000, 0)
Height: IF(page()=pageCount() AND mod(pageCount(),2)=1, 1000, 0)

Now, every second page is a blank. I tried with setting only the Height or Width, but with the same result.

Any ideas?

 
This couldn't have anything to do with the fact that it generates a PDF instead of sending it directly to a printer, could it?

Is it possible to embed the control sequence for PDF/PS?

TIA
 
So.. after some additional experimentation, I have proven to myself that the formulas do indeed work based on page() and pageCount() in that I can make text appear in different places and in different text-box sizes based on the values of the page() and pageCount() functions.

The frustrating bit is still the way that I have to force a formfeed to get a blank page. If I understand the posts here and on other sites, the only way to get a blank page is to force a printable element into unprintable space, either vertically or horizontally.

I cannot figure out why, then, I am generating a blank after every page instead of at the points that I need it if the Visible attribute (and Height and Width attributes) can be controlled with working formulas.

Does anybody have an idea of where I should prod next?

TIA.
 
Have you looked at the PrintDatawindow method? You could possibly dump the 'second' part of the report into a second datawindow, hide it on the first, then print both?

Whenever I've had specialized forms to print I've always used printopen, then all the various print commands, then printclose. This gives you much more control over the output.

Sorry I can't be more help.

Matt

"Nature forges everything on the anvil of time"
 
I appreciate the attempt. I am not really a PB guy, so maybe some additional information would help.

The application was ported to .NET and the reports are stored in a .PBL/.PBD on the server. It is a third-party app so I don't have access to source; the only thing I have access to is the library, so unfortunately I cannot control the calls.

I guess my question is now: would this particular form work as expected if it was in a pure PB environment? Is there something about the call or environment that makes it not work as expected?

TIA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top