How to print a flat file in ASP.NET 2.0

G

Guest

I need to print a flat file or send printer controls to a specified printer
or port (lpt1,lpt2, com1...) in a web page.
Is it possible? How?
 
E

Eliyahu Goldin

It's a client-side task and you do it with a javascript call

window.print()

It will open the browser's Print dialog. There is no way how you can bypass
the dialog and select printer programmatically unless you employ an ActiveX
control.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
G

Guest

Ok, thanks. I think i needd an activex.
--
JLobo


Eliyahu Goldin said:
It's a client-side task and you do it with a javascript call

window.print()

It will open the browser's Print dialog. There is no way how you can bypass
the dialog and select printer programmatically unless you employ an ActiveX
control.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


JLobo said:
I need to print a flat file or send printer controls to a specified printer
or port (lpt1,lpt2, com1...) in a web page.
Is it possible? How?
 
M

Mark Rae [MVP]

Ok, thanks. I think i need an activex.

Think *very* carefully before you go down that route, though...

1) ActiveX controls only work in IE

2) You will need to seriously ramp down browser security just to get them to
work at all

3) If you manage to find a 3rd-party control, make absolutely sure it's from
a reputable and reliable source - you're going to have to lower browser
security down so far that this ActiveX control is allowed to talk directly
to the local machine's hardware...

I would seriously advise you to try to find an alternative solution if at
all possible...
 
C

Cowboy \(Gregory A. Beamer\)

window.print(), as mentioned, will work client side. It will not target a
particular printer, however. The user will have to do that.

If you need to target a printer, and this is an intranet, you can create a
"print" button that is keyed, server side, to a particular printer. It would
not print from the client side, but would solve your problem. For an
Enterprise, you would have to map users to printers, but it could be done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top