472,789 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

print a page

rom
I need to print a html table when the user clicks on a
key. the problem is that i don't want the printer dialog
box to appear. i guess this is impossible in javascript so
i think to create an event that will be fired by a keyup
event, this event will submit the page, and i will be able
to print in from the vb.net without the printing dialog
box. the problem is that on the server i can't print the
web table because i already submitted that page.....well,
what i'm saying here is that i need help because i don't
know where to begin...i only know 1 thing - i need to
print the table after the user hits a key and the
operation must be very quick.

Thanks.
Nov 19 '05 #1
4 2286
You cant print without that dialogue - its a security thing. How would you
like to visit spam.com and suddleny have a million pages printing at your
printer without you requesting them - which is in effect what you are trying
to do.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"rom" <me****@ifat.com> wrote in message
news:07****************************@phx.gbl...
I need to print a html table when the user clicks on a
key. the problem is that i don't want the printer dialog
box to appear. i guess this is impossible in javascript so
i think to create an event that will be fired by a keyup
event, this event will submit the page, and i will be able
to print in from the vb.net without the printing dialog
box. the problem is that on the server i can't print the
web table because i already submitted that page.....well,
what i'm saying here is that i need help because i don't
know where to begin...i only know 1 thing - i need to
print the table after the user hits a key and the
operation must be very quick.

Thanks.

Nov 19 '05 #2
Yes, I knew this is the limitation of Javascript.

However, from the MCP website, in the page to print the transcript, there is
an ActiveX button to print the transcript automatically without prompting
the print dialog box, do you have any idea on how do they achieve this?

Regards
Weichung

"John Timney (ASP.NET MVP)" <ti*****@despammed.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You cant print without that dialogue - its a security thing. How would
you
like to visit spam.com and suddleny have a million pages printing at your
printer without you requesting them - which is in effect what you are
trying
to do.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"rom" <me****@ifat.com> wrote in message
news:07****************************@phx.gbl...
I need to print a html table when the user clicks on a
key. the problem is that i don't want the printer dialog
box to appear. i guess this is impossible in javascript so
i think to create an event that will be fired by a keyup
event, this event will submit the page, and i will be able
to print in from the vb.net without the printing dialog
box. the problem is that on the server i can't print the
web table because i already submitted that page.....well,
what i'm saying here is that i need help because i don't
know where to begin...i only know 1 thing - i need to
print the table after the user hits a key and the
operation must be very quick.

Thanks.


Nov 19 '05 #3
I'm running into the same issue. We're using IE in kiosk mode with a touch
screen interface on a dedicated machine for an internal application.
Bypassing this dialouge is necessary to keep the "users" out of the print
settings ect... :-)

If it were my choice, and it's not, I would not use the browser as the
interface at all. However, since the browser interface is so popular, I
should still be able to do whatever I want even if it is stupid and insecure.

There must be a way to do this. The print button on the toolbar still
bypasses the dialogue....hmmm

Anyway, if I figure it out, I'll post it here.

"weichung[MCSD,MCDBA]" wrote:
Yes, I knew this is the limitation of Javascript.

However, from the MCP website, in the page to print the transcript, there is
an ActiveX button to print the transcript automatically without prompting
the print dialog box, do you have any idea on how do they achieve this?

Regards
Weichung

"John Timney (ASP.NET MVP)" <ti*****@despammed.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You cant print without that dialogue - its a security thing. How would
you
like to visit spam.com and suddleny have a million pages printing at your
printer without you requesting them - which is in effect what you are
trying
to do.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"rom" <me****@ifat.com> wrote in message
news:07****************************@phx.gbl...
I need to print a html table when the user clicks on a
key. the problem is that i don't want the printer dialog
box to appear. i guess this is impossible in javascript so
i think to create an event that will be fired by a keyup
event, this event will submit the page, and i will be able
to print in from the vb.net without the printing dialog
box. the problem is that on the server i can't print the
web table because i already submitted that page.....well,
what i'm saying here is that i need help because i don't
know where to begin...i only know 1 thing - i need to
print the table after the user hits a key and the
operation must be very quick.

Thanks.



Nov 19 '05 #4
Using IE resource kit you can disable the buttons for print and stop the
user changing setting etc which would solve your specific problem I expect.

There is a cludge that works in IE only - the code is shown below. You
might want to add a bit of div code around the print button that hides it
when the script executes so its not printed. Personally I would avoid this
type of thing but if it does the job then problem solved.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
<html>

<head>

<SCRIPT LANGUAGE="javascript">

// VALUES: intOLEcmd has these possible values
// OLECMDID_OPEN = 1
// OLECMDID_NEW = 2 warning, this kills IE
windows!
// OLECMDID_SAVE = 3
// OLECMDID_SAVEAS = 4
// OLECMDID_SAVECOPYAS = 5 note: does nothing in IE
// OLECMDID_PRINT = 6 note: give '-1' as param -
no prompt!
// OLECMDID_PRINTPREVIEW = 7
// OLECMDID_PAGESETUP = 8
function ieExecWB( intOLEcmd, intOLEparam )
{

// Create OLE Object
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

// Place Object on page
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

// if intOLEparam is not defined, set it
if ( ( ! intOLEparam ) || ( intOLEparam < -1 ) || ( intOLEparam > 1 ) )
intOLEparam = 1;

// Execute Object
WebBrowser1.ExecWB( intOLEcmd, intOLEparam );

// Destroy Object
WebBrowser1.outerHTML = "";
}

</script>

</head>
<body>

<button onClick="ieExecWB(6, -1)">
Print Me! - No Prompt!
</button>

Some text and other stuff to print
</body>
</html>



"John Wall" <John Wa**@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
I'm running into the same issue. We're using IE in kiosk mode with a touch
screen interface on a dedicated machine for an internal application.
Bypassing this dialouge is necessary to keep the "users" out of the print
settings ect... :-)

If it were my choice, and it's not, I would not use the browser as the
interface at all. However, since the browser interface is so popular, I
should still be able to do whatever I want even if it is stupid and insecure.
There must be a way to do this. The print button on the toolbar still
bypasses the dialogue....hmmm

Anyway, if I figure it out, I'll post it here.

"weichung[MCSD,MCDBA]" wrote:
Yes, I knew this is the limitation of Javascript.

However, from the MCP website, in the page to print the transcript, there is an ActiveX button to print the transcript automatically without prompting the print dialog box, do you have any idea on how do they achieve this?

Regards
Weichung

"John Timney (ASP.NET MVP)" <ti*****@despammed.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You cant print without that dialogue - its a security thing. How would you
like to visit spam.com and suddleny have a million pages printing at your printer without you requesting them - which is in effect what you are
trying
to do.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"rom" <me****@ifat.com> wrote in message
news:07****************************@phx.gbl...
> I need to print a html table when the user clicks on a
> key. the problem is that i don't want the printer dialog
> box to appear. i guess this is impossible in javascript so
> i think to create an event that will be fired by a keyup
> event, this event will submit the page, and i will be able
> to print in from the vb.net without the printing dialog
> box. the problem is that on the server i can't print the
> web table because i already submitted that page.....well,
> what i'm saying here is that i need help because i don't
> know where to begin...i only know 1 thing - i need to
> print the table after the user hits a key and the
> operation must be very quick.
>
> Thanks.


Nov 19 '05 #5

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

Similar topics

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...
3
by: Umut Tezduyar | last post by:
In the msdn.microsoft.com/library most of the articles have an "print" option. But the "print" button is different from the javascripts "window.print()" method. It postpacks the page and then...
0
by: Paco Ferre | last post by:
Hello, I founded some examples of WebControl printing in internet and tryed to have them working for a DataGrid, something not very complicated. I have a page, Page1.aspx with a DataGrid...
16
by: Neal | last post by:
Hi, I saw the VB6 Code to do this at this link: http://www.dotnet247.com/247reference/msgs/11/56581.aspx The VB6 Code reads as follows: Private Type Rect Left As Long
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
0
by: ShaneO | last post by:
There have been similar questions raised in the past, however no answers seem to have been provided, so I thought I'd give it a go. Scenario 1: My Windows Forms app generates (say) 10 pages in a...
4
by: CSharpguy | last post by:
My web app is using master pages, On the content page I'm using a GridView. I need to print my GridView and I need to exclude the HyperLink columns. How can I print my content page and exclude the...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
2
by: bob | last post by:
Hi, I have a page that has a collection of things which it passes to a second 'print' page using a session variable. The print page has buttons for moving though the collection and the user ...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.