469,140 Members | 1,205 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

Implementing print functionality in ASP.NET web application

Hi there!

I'm a total newbie at web development, so I started bydownloading and
installing Visual Web Developer 2005 Express Edition as well as SQL Server
2005 Express Edition. I also downloaded several starterkits and studied the
MSDN articles on these starterkits. I learned quite a lot from them and got
things started nicely. There is one thing that I hoped to find, however, but
didn't. That is how to implement printing in my web application. Just
printing the web page itself is one thing, but I'd also like to enable my
users to print reports, preferably in some sort of company housestyle.

I already looked into the options of the ReportViewer object, which seem to
cover what I need for my application. However, when I include the object in
my web page, the Print button doesn't show, so for some weird reason that
doesn't work. Maybe I'm doing something wrong.

Are there any whitepapers or other technical articles that can help me get
what I want? Or can anyone provide me with an example (ASP.NET/C#) that I can
use?

Any help will be greatly appreciated!!

Greetings, Vera

Oct 22 '06 #1
4 4019
Vera,
There's a ShowPrintButton property that can be set to true/false.
Now, because it's a web app, you really don't have the same control over
printing that you would with a desktop app. HTML and Javascritp only enable
so much with printing as the basic design of a web browser precludes this
kind of access (security hazard and all). You could control certain aspects
using CSS as most modern browsers support the ability to define a special
print set of styles that define the appearance of the document when it's
printed out, but doesn't show it when it's being viewed in the browser.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Vera" <Ve**@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Hi there!

I'm a total newbie at web development, so I started bydownloading and
installing Visual Web Developer 2005 Express Edition as well as SQL Server
2005 Express Edition. I also downloaded several starterkits and studied
the
MSDN articles on these starterkits. I learned quite a lot from them and
got
things started nicely. There is one thing that I hoped to find, however,
but
didn't. That is how to implement printing in my web application. Just
printing the web page itself is one thing, but I'd also like to enable my
users to print reports, preferably in some sort of company housestyle.

I already looked into the options of the ReportViewer object, which seem
to
cover what I need for my application. However, when I include the object
in
my web page, the Print button doesn't show, so for some weird reason that
doesn't work. Maybe I'm doing something wrong.

Are there any whitepapers or other technical articles that can help me get
what I want? Or can anyone provide me with an example (ASP.NET/C#) that I
can
use?

Any help will be greatly appreciated!!

Greetings, Vera

Oct 22 '06 #2
<A href="javascript:window.print()">
Print Me!</A"Vera" <Ve**@discussions.microsoft.comwrote in message news:35**********************************@microsof t.com...
Hi there!

I'm a total newbie at web development, so I started bydownloading and
installing Visual Web Developer 2005 Express Edition as well as SQL Server
2005 Express Edition. I also downloaded several starterkits and studied the
MSDN articles on these starterkits. I learned quite a lot from them and got
things started nicely. There is one thing that I hoped to find, however, but
didn't. That is how to implement printing in my web application. Just
printing the web page itself is one thing, but I'd also like to enable my
users to print reports, preferably in some sort of company housestyle.

I already looked into the options of the ReportViewer object, which seem to
cover what I need for my application. However, when I include the object in
my web page, the Print button doesn't show, so for some weird reason that
doesn't work. Maybe I'm doing something wrong.

Are there any whitepapers or other technical articles that can help me get
what I want? Or can anyone provide me with an example (ASP.NET/C#) that I can
use?

Any help will be greatly appreciated!!

Greetings, Vera

Oct 22 '06 #3
I tried the ShowPrintButton property. Even if I set it to true, the button
doesn't show.

There must be some way to get some printing done from a web page. Even this
page from which I entered my question has a button saying 'Print Post'. So
it's obviously not impossible. But how does it work? What objects and/or
classes do I need and how do I use them? And you say something about CSS. How
do I use that? Do you have an example?

Vera
"Mark Fitzpatrick" wrote:
Vera,
There's a ShowPrintButton property that can be set to true/false.
Now, because it's a web app, you really don't have the same control over
printing that you would with a desktop app. HTML and Javascritp only enable
so much with printing as the basic design of a web browser precludes this
kind of access (security hazard and all). You could control certain aspects
using CSS as most modern browsers support the ability to define a special
print set of styles that define the appearance of the document when it's
printed out, but doesn't show it when it's being viewed in the browser.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Vera" <Ve**@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Hi there!

I'm a total newbie at web development, so I started bydownloading and
installing Visual Web Developer 2005 Express Edition as well as SQL Server
2005 Express Edition. I also downloaded several starterkits and studied
the
MSDN articles on these starterkits. I learned quite a lot from them and
got
things started nicely. There is one thing that I hoped to find, however,
but
didn't. That is how to implement printing in my web application. Just
printing the web page itself is one thing, but I'd also like to enable my
users to print reports, preferably in some sort of company housestyle.

I already looked into the options of the ReportViewer object, which seem
to
cover what I need for my application. However, when I include the object
in
my web page, the Print button doesn't show, so for some weird reason that
doesn't work. Maybe I'm doing something wrong.

Are there any whitepapers or other technical articles that can help me get
what I want? Or can anyone provide me with an example (ASP.NET/C#) that I
can
use?

Any help will be greatly appreciated!!

Greetings, Vera


Oct 22 '06 #4
Vera,
No object or class will do it. The Print Post button I believe
you're seeing (I don't see it as I'm accessing the group through a
newsreader directly and not a web interface) will only use a JavaScript on
the client to invoke the print dialog. There's not much else that is or can
be done as you can't create server-side print code because that won't affect
the browser, and the browser is designed to prevent any malicious code from
running features of the OS.

Run a search over at www.dynamicdrive.com for some JavaScript print
functions. There are a few, but all they can really do is invoke the print
dialog. There's one implementation at:
http://www.dynamicdrive.com/dynamicindex9/other1.htm A little more complex
than some, but supposedly cross-browser compatible.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Vera" <Ve**@discussions.microsoft.comwrote in message
news:F2**********************************@microsof t.com...
>I tried the ShowPrintButton property. Even if I set it to true, the button
doesn't show.

There must be some way to get some printing done from a web page. Even
this
page from which I entered my question has a button saying 'Print Post'. So
it's obviously not impossible. But how does it work? What objects and/or
classes do I need and how do I use them? And you say something about CSS.
How
do I use that? Do you have an example?

Vera
"Mark Fitzpatrick" wrote:
>Vera,
There's a ShowPrintButton property that can be set to true/false.
Now, because it's a web app, you really don't have the same control over
printing that you would with a desktop app. HTML and Javascritp only
enable
so much with printing as the basic design of a web browser precludes this
kind of access (security hazard and all). You could control certain
aspects
using CSS as most modern browsers support the ability to define a special
print set of styles that define the appearance of the document when it's
printed out, but doesn't show it when it's being viewed in the browser.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Vera" <Ve**@discussions.microsoft.comwrote in message
news:35**********************************@microso ft.com...
Hi there!

I'm a total newbie at web development, so I started bydownloading and
installing Visual Web Developer 2005 Express Edition as well as SQL
Server
2005 Express Edition. I also downloaded several starterkits and studied
the
MSDN articles on these starterkits. I learned quite a lot from them and
got
things started nicely. There is one thing that I hoped to find,
however,
but
didn't. That is how to implement printing in my web application. Just
printing the web page itself is one thing, but I'd also like to enable
my
users to print reports, preferably in some sort of company housestyle.

I already looked into the options of the ReportViewer object, which
seem
to
cover what I need for my application. However, when I include the
object
in
my web page, the Print button doesn't show, so for some weird reason
that
doesn't work. Maybe I'm doing something wrong.

Are there any whitepapers or other technical articles that can help me
get
what I want? Or can anyone provide me with an example (ASP.NET/C#) that
I
can
use?

Any help will be greatly appreciated!!

Greetings, Vera



Oct 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Ben | last post: by
4 posts views Thread by Wendy Elizabeth | last post: by
69 posts views Thread by Edward K Ream | last post: by
8 posts views Thread by nickooooola | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.