473,386 Members | 1,793 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.

How to print a flat file in ASP.NET 2.0

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
Sep 19 '07 #1
5 1609
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" <JL***@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
>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

Sep 19 '07 #2
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" <JL***@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
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


Sep 19 '07 #3
"JLobo" <JL***@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
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

Sep 19 '07 #4
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]" <ma**@markNOSPAMrae.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
"JLobo" <JL***@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
>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

Sep 19 '07 #5
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" <JL***@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
>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

Sep 19 '07 #6

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

Similar topics

13
by: raykyoto | last post by:
Hi all, I'm sure this is a popular question that comes up every few months here. Indeed, I've looked at some of the past postings, but I would like to ask things differently. Basically, I'm...
1
by: Tim Fierro | last post by:
Hello, I have had many years using flat file databases (File Express from way back) but am now at a company where a relational database is needed and would carry us into the future. Since I...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
4
by: Ben | last post by:
So, at my place of employment, we use a national standard to transmit data between certain applications. This standard consists of a fixed width, flat file 4500-some-odd chars wide that contain...
2
by: Neural | last post by:
Hi, I was wondering if anybody knew of any other ways of efficiently parsing a flat file into SQL Server 2000 using C#. The flat files are tab delimited. And the general file size is around 1 GB...
9
by: FFMG | last post by:
In my site I have a config table, (MySQL), with about 30 entries; the data is loaded on every single page load. This is not the only call to the db, (we do a total of about 8 calls to the db). As...
2
by: =?Utf-8?B?SkxvYm8=?= | last post by:
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? Thanks for the help -- JLobo
2
by: murthydb2 | last post by:
Hi My requirement is that i have to write a stored procedure in db2 and that will be executed in a batch file . Any system error or validation error that occurs inside the db2 sp during...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.