Print the page without loading it

A

Alan

While not rs.eof
<td><%=rs("InvoiceNo")%></td>
<td><%=rs("Name")%></td>
<td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td>
<td>Print this invoice</td>
rs.MoveNext
Wend

Now user needs to click the link to open the invoice, and then select
File--Print from the menu to print it out, and then return back to print
another. As the table is very long, they need to scroll again to find the
next one.

I want to make the user more comfortable, that they
simply click the "Print" button in the end of the row, without opening the
page, print the invoice no they want. Is it possible ?
 
M

McKirahan

Alan said:
While not rs.eof
<td><%=rs("InvoiceNo")%></td>
<td><%=rs("Name")%></td>
<td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td>
<td>Print this invoice</td>
rs.MoveNext
Wend

Now user needs to click the link to open the invoice, and then select
File--Print from the menu to print it out, and then return back to print
another. As the table is very long, they need to scroll again to find the
next one.

I want to make the user more comfortable, that they
simply click the "Print" button in the end of the row, without opening the
page, print the invoice no they want. Is it possible ?

You could just open up the Invoice in a new window:

<a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>" target="_blank"></a>

Also, you could educate your users to click the printer icon
(one of the Standard Buttons) rather than clicking File+Print.

If you do achieve silent printing I'd inform the user via an alert()
that an invoive print was performed; otherwise, they may click
repeatedly not knowing what's happening --
(as the printer may be located elsewhere).
 
A

Alan

Thanks for yr help, because my program run in full screen, thus no icon and
buttons, and I expected when the users click print, then a printer dialog
box appear, they can select which printer they want. So I still need the
answers. I tried to write in jscript, but don't work, I tried to post to
js.group, noone can answers, I search in Google, over hundred messages want
to do this, but no method, is it possible, or someone has another better way
to do this ?
 
B

Bob Barrows [MVP]

How about using a checkbox instead of a link in your table? Allow the user
to select the rows he wants to print, then click a single button outside the
table to print all the selected invoices? The button would submit to a page
that loads all the selected invoices, using window.print in the onload event
to bring up the print dialog.

Bob Barrows
 
A

Alan

Thanks, if open all the invoice in new windows, that means the user need to
close all the windows after finished. Meanwhile, I have try the window.print
onload event before, the result of course will open the invoice first, the
different is then show the print dialog box automatically, what I want is to
print the page in routine without loading it. I search hundred of message
from other websites about this issue, it seems very popular and many people
want to do this. I have download a "PrintHid.js" from microsoft.com, but it
can't work with ASP routine, since one is client-side and one is
server-side. I search for this answer for a long time, Can anyone help me.
 
B

Bob Barrows [MVP]

No! I meant: open a single window with all the selected invoices displayed
in that window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top