472,958 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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 4175
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ben | last post by:
Hi all, I implemented a stack in C++ in 2 different ways and I'd like to know which approach is better than the other.. and if there is any difference between the two? I'd also like to know if...
4
by: Wendy Elizabeth | last post by:
I would like to know how to print a crystal report that was generated in the ..NET framework using a Visual Basic.NET web application and/or a Visual basic.NET windows application. When crystal...
2
by: philip.mckee | last post by:
Hi Looking for some very general advice. I have a classic asp content management application which I am porting to ASP.NET. The database is SQL server, and it is hoped that we can leverage this...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
69
by: Edward K Ream | last post by:
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
4
by: zacks | last post by:
Most applications whose purpose is to work with various types of files implement a "Most Recent Files" list, where the last, say, four files accessed by the application can quickly be re-opened by...
3
by: xr0krx | last post by:
Hi, Im having some problems with my program. I'm kinda new to this stuff; only been doing this for about a month. What it's suppose to do is ask the user to input a word, and then print out the word...
8
by: nickooooola | last post by:
Hello to all I'm about to write a simulator for a microcontroller in python (why python? because I love it!!!) but I have a problem. The registry of this processor are all 8 bit long (and 10...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.