WebForm's Response.Write to create pop up window for printing repo

G

Guest

I want to create a pop up window for printing report, but I encounter some
problem.
(1). If use showModalDialog, then the toolbar of the browser is missing,
can i display the print toolbar for user to print the report ?
(2). I finally come up with the below solution, however I have to use
"setTimeout"
in order to show the popup form on top of the parent form.
Is there any way to skip using the setTimeout method ?

strPopup = "<script language='javascript'>var
newwin=window.open('Rpt_Friendly_DNote.aspx?Param1=" &
strAirWayBillNbr & "'); " & _
"newwin.window.moveTo(0,0); " & _
"newwin.window.resizeTo(screen.availWidth,
screen.availHeight); " & _
"setTimeout('newwin.focus()',50); " & _
"</script>"

Response.Write(strPopup)
 
E

Eliyahu Goldin

You can print from a modal dialog. Just add a "Print" button to the page and
call window.print() in onclick event. Hide the button in onbeforeprint
event, and show it again in onafterprint.

Eliyahu
 

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

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top