Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to print a flat file in ASP.NET 2.0

Reply
Thread Tools

How to print a flat file in ASP.NET 2.0

 
 
=?Utf-8?B?SkxvYm8=?=
Guest
Posts: n/a
 
      09-19-2007
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?
--
JLobo
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-19-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
> --
> JLobo



 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxvYm8=?=
Guest
Posts: n/a
 
      09-19-2007
Ok, thanks. I think i needd an activex.
--
JLobo


"Eliyahu Goldin" wrote:

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

>
>
>

 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      09-19-2007
"JLobo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      09-19-2007
if its a flat file, why cant you just render it into the browser as textual
output and use window.print as suggested - why woud you need an alternative.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:%23lHt69q%(E-Mail Removed)...
> "JLobo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> 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...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      09-19-2007
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"JLobo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
> --
> JLobo



 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
XSLT to transform a "flat" XML file into a structured text file R. P. XML 3 06-22-2006 02:26 AM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments