How to print a flat file in ASP.NET 2.0

Discussion in 'ASP .Net' started by =?Utf-8?B?SkxvYm8=?=, Sep 19, 2007.

  1. 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
     
    =?Utf-8?B?SkxvYm8=?=, Sep 19, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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
     
    Eliyahu Goldin, Sep 19, 2007
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > >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

    >
    >
    >
     
    =?Utf-8?B?SkxvYm8=?=, Sep 19, 2007
    #3
  4. "JLobo" <> wrote in message
    news:...

    > 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
     
    Mark Rae [MVP], Sep 19, 2007
    #4
  5. 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]" <> wrote in message
    news:%23lHt69q%...
    > "JLobo" <> wrote in message
    > news:...
    >
    >> 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
     
    John Timney \(MVP\), Sep 19, 2007
    #5
  6. 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" <> wrote in message
    news:...
    >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
     
    Cowboy \(Gregory A. Beamer\), Sep 19, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. R. P.
    Replies:
    3
    Views:
    8,311
    Joe Kesselman
    Jun 22, 2006
  2. swordedotcom
    Replies:
    0
    Views:
    376
    swordedotcom
    Apr 23, 2006
  3. keto
    Replies:
    0
    Views:
    1,018
  4. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    386
    David Cournapeau
    Dec 30, 2008
  5. c676228
    Replies:
    3
    Views:
    370
    Mike Brind [MVP]
    Jul 17, 2008
Loading...

Share This Page