Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > WebForm's Response.Write to create pop up window for printing repo

Reply
Thread Tools

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

 
 
=?Utf-8?B?RXJpYw==?=
Guest
Posts: n/a
 
      01-20-2005
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
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-20-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
 
 
 
=?Utf-8?B?RXJpYw==?=
Guest
Posts: n/a
 
      01-21-2005
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-21-2005
No, this you can't have.

Eliyahu

"Eric" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add bitbucket repo url to install_requires Julian Python 1 10-08-2010 08:55 AM
Program create xsd for Crystal Report and provide all data on repo JB ASP .Net 2 04-08-2010 01:08 AM
working with a subversion repo Luke Python 3 01-17-2008 06:27 PM
Repo Man... which edition? Aphelion DVD Video 0 01-31-2004 04:13 AM
"Repo Man" question Vlvetmorning98 DVD Video 3 01-09-2004 04:30 AM



Advertisments