Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 01-20-2005, 06:21 AM   #1
Default WebForm's Response.Write to create pop up window for printing repo


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==?=
  Reply With Quote
Old 01-20-2005, 07:22 AM   #2
Eliyahu Goldin
 
Posts: n/a
Default Re: WebForm's Response.Write to create pop up window for printing repo

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)
>



  Reply With Quote
Old 01-21-2005, 05:47 AM   #3
=?Utf-8?B?RXJpYw==?=
 
Posts: n/a
Default Re: WebForm's Response.Write to create pop up window for printing

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)
> >

>
>
>

  Reply With Quote
Old 01-21-2005, 11:01 AM   #4
Eliyahu Goldin
 
Posts: n/a
Default Re: WebForm's Response.Write to create pop up window for printing

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)
> > >

> >
> >
> >



  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump