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

Printing Problem

Status
Not open for further replies.

clegg

Programmer
Jan 25, 2001
98
GB
I have the need to print a report via a browser.

The report is not displayed in the browser but the user needs to be able to click a button and it will print.

The report will be generated from database information based on parameters that have already been supplied and there is an added complication that I need to print a barcode as part of the report.

I have done this all fine and dandy in VB6 but now I need to do it from the web.

Can anyone shed any light on how I'd approach this.

Cheers
Clegg
 
Javascript:

1. Opens a new window with url as somepage.php?param1=a&param2=b...
2. The new page, using server-side coding, echoes the value of the barcode.
3. In the body tag of the page, have:
Code:
onload="window.print(),setTimeout('window.close();',3000);"
This has the page print itself and then close after three seconds.

Come back if you need code help.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Silly chessbot, he meant a ; between the print() statement and the setTimeout statement, not a comma.

He also meant that, while it will bring up the print dialog screen, it won't print automatically. You'll still have to press OK.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
yeah... thanks, cLFlaVA.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top