473,462 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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)

Nov 19 '05 #1
3 2739
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" <Er**@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
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)

Nov 19 '05 #2
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" <Er**@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
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)


Nov 19 '05 #3
No, this you can't have.

Eliyahu

"Eric" <Er**@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
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" <Er**@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
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)


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cathy | last post by:
Has anyone ever made a webform button run an onClick event that is a Javascript in the HTML code and then after running the script make it go into the code-behind? An HTML button will run the...
6
by: Phillip N Rounds | last post by:
I have a webform, from which I have to submit info to another site. Their instructions are to have a html form, with the following as the submit: <form method="post"...
4
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
6
by: Newbie | last post by:
Hi! In C# asp.net, how do I close a popup window (an aspx webform)? I have a link button handler below: private void LinkButton1_Click(object sender, System.EventArgs e) { this. ...
2
by: Paul Hale | last post by:
Hi, I have two web forms (lets call them webform1 and webform2) that run as part of the same web application. Webform1 contains a text box. I would like to pop up a new browser window...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
5
by: Ben | last post by:
Hi All, User click on a Web Button. -->.....Some code to do something.... --->Then a webpage opened in different Target Window How can I do that? What codes I should use? Thank you, Ben
1
by: ffhansix | last post by:
Hi, I have migrated a web site from .NET 1.1.4322 to .NET 2.0. After the migration my Modal webform does not work as it did in 1.1. The webform pops up from a page when a user clicks a button:...
3
by: Nuno | last post by:
How can I instantiate a webform2 object from webfrom1 codebehind? The class does not popup in intellisense and gives me and error if i try to create it. Nuno
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.