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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formating problem

Status
Not open for further replies.

Elmserv

Programmer
Sep 25, 2004
72
GB
I am putting this chunk of code at the start of a report

$cOutput= '<input type="button" value="Print this page" onClick="window.print()">';

I print $cOutput to the screen afterwards

At the mo it repeats itself on every screen, can I have it so it only prints once?

Rich
 
would a different tack be helpfull.

I was thinking of creating a pdf file then printing it


rich
 
With the amount of code you provided, it is impossible to figure out what it is that is causing the problem.

Does the button appear on one page multiple times? Then you have it printing out either in a loop or multiple print/echo statements.

Does it print at the end of each page? Then you're including it (or every page is rendered by the same script) on every page. Try either including it only on the relevant pages or include a logic that checks which page it is and only puts it on the relevant page.

That's about all we can help you with.
 
I have just cracked it, several faults.

1. it was in a loop

2. the variable $cOutput was not being reset after printing a page

How difficult is it to do a pdf, I am not to keen on the footer saying the name of the file & the date

rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top