![]() |
|
|
|||||||
![]() |
ASP Net - WebForm's Response.Write to create pop up window for printing repo |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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) =?Utf-8?B?RXJpYw==?= |
|
|
|
|
#2 |
|
Posts: n/a
|
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 "Eric" <> wrote in message news:81FB2189-7437-47F0-83D3-... > 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) > |
|
|
|
#3 |
|
Posts: n/a
|
Thanks. But can I have a Print Preview function as well ???
"Eliyahu Goldin" wrote: > 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 > > "Eric" <> wrote in message > news:81FB2189-7437-47F0-83D3-... > > 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) > > > > > |
|
|
|
#4 |
|
Posts: n/a
|
No, this you can't have.
Eliyahu "Eric" <> wrote in message news:0B2B5C5F-9E17-45D3-A060-... > Thanks. But can I have a Print Preview function as well ??? > > > > "Eliyahu Goldin" wrote: > > > 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 > > > > "Eric" <> wrote in message > > news:81FB2189-7437-47F0-83D3-... > > > 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) > > > > > > > > > |
|