473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Self Print HTML page.

Hi,
I have developed an ASP.Net application to assist our Field Engineers
compile online site survey's for on site assets. The application is
functional except for a major setback which is the prinitng of all the
workorders at the end of the day. The supervisor has a page which displays
the WO's for the day (roughly 30-40) in a datagrid, each of which has to be
individually clicked to launch an HTML report page, which he then has to
print...
:-(
Is there any way in which the launched page can print itself to the default
printer.
I can then have the page launched, printed and closed, which can then be
modified to a Datagrid with checkboxes etc... the only glitch is the self
printing pages!!!
Help!!!

Sunil Thomas.
Nov 20 '05 #1
5 1986
Cor
Hi Sunil,
Is there any way in which the launched page can print itself to the default printer.


I think this is on the client side. VB.net works on the serverside.
So you have a better change to get an answer in the asp.net newsgroup or in
a javascript newsgroup. (But maybe you get your answer her).

But I can help you a littlebit. If you got the javascript, you can start
that from the serverside in VB.net, that is with something like
\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
I hope this helps a little bit?

Cor
Nov 20 '05 #2
Hi Cor,
Maybe I should have been a bit more specific.

Yes, your analysis of my problem is extremely accurate and that is exactly
the solution for which I was hunting.

Below is the code implemnting the client side of things.

<body onload="DoPagePrint()" bottomMargin="4" leftMargin="5" topMargin="4"
rightMargin="0" MS_POSITIONING="GridLayout">

<script language=javascript>
function DoPagePrint()
{
self.print();
}
</script>

This does what I want to some extent, however, I want to do away with the
print dialog box and print directly to the printer.

Any ideas????

Thanks for the help so far.....

Regards,
Sunil

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader22.wxs.nl...
Hi Sunil,
Is there any way in which the launched page can print itself to the default
printer.


I think this is on the client side. VB.net works on the serverside.
So you have a better change to get an answer in the asp.net newsgroup or

in a javascript newsgroup. (But maybe you get your answer her).

But I can help you a littlebit. If you got the javascript, you can start
that from the serverside in VB.net, that is with something like
\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');} </script>"
RegisterStartupScript("Startup", str)
///
I hope this helps a little bit?

Cor

Nov 20 '05 #3
Cor
Hi Sunil,

If I was you, I should not look for it.

This is on MSDN.

Printing from script is supported in Internet Explorer 5 and later by
calling Window.Print. However, this always displays the Print dialog box,
which can't be suppressed. Printing is considered a security issue; a Web
page should not have the ability to start a print job without confirmation
from the user.

You have a change that when you have found it, the next Microsoft security
patch kills your solution.

Cor
Nov 20 '05 #4
Hi Cor,

I can't believe this is the end of my project, due to such a technicality...
Thanks a lot for your help.
Though I am too far in to give up now... maybe something like a trusted
process, activeX something.... must be able to achieve it....
You have been kind to this disheartened soul...
Happy coding.

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
Hi Sunil,

If I was you, I should not look for it.

This is on MSDN.

Printing from script is supported in Internet Explorer 5 and later by
calling Window.Print. However, this always displays the Print dialog box,
which can't be suppressed. Printing is considered a security issue; a Web
page should not have the ability to start a print job without confirmation
from the user.

You have a change that when you have found it, the next Microsoft security
patch kills your solution.

Cor

Nov 20 '05 #5
Cor
Hi Sunil,
When you don't give up, you can turn the project around.
Make a window application, which get the information from your website.
Then you don't have that trouble I think
Cor
Nov 20 '05 #6

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

Similar topics

37
by: Grzegorz Staniak | last post by:
Hello, I'm a newbie Python user, a systems administrator - I've been trying to switch from Perl to Python for administrative tasks - and one thing I cannot understand so far is why I need the...
0
by: Ravi Teja Bhupatiraju | last post by:
>> Well make it three cents and do an implementation, if you really care. >> Otherwise, it's just words... I can't post a reply to that thread in Google. So I am posting the third cent here. ...
13
by: Frans Englich | last post by:
Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my...
21
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want...
18
by: Ralf W. Grosse-Kunstleve | last post by:
My initial proposal (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't exactly get a warm welcome... And Now for Something Completely Different: class autoinit(object):...
2
by: prophet | last post by:
how do I create a print button that is on my index page that prints my target page (and only the target page) I tried <INPUT onclick=window.print(); type=button value="Print This Page"...
0
by: petr.jakes.tpc | last post by:
Hi, I am trying to dig through User-defined Exceptions (http:// docs.python.org/tut/node10.html chapter 8.5) is it OK to add following line to the __init__ method of the TransitionError class?...
1
by: lpyth | last post by:
class abc: def __init__(self,x,y,z): self.x = x self.y = y self.z = z def add(self): c = self.x + self.y + self.z
4
by: harijay | last post by:
Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.