Asp.Net and printing

C

Chris Dunaway

I have a simple .asp page in which is included an IFrame that loads
and Asp.Net page. The asp.net page takes and xml document and uses an
xslt transformation to generate the html for output. The output is
just a viewable only report.

Inside the .aspx page, I have registered a simple client side script
to print the contents of the IFrame like this:

string printScript = @"function PrintIt() { window.print(); }";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"printScript", printScript, true);

In the .xslt, I have placed a standard input tag to serve as the
"Print" button. This works fine for my needs but I had two questions
regarding this method:

1. When the report is printed, the button is visible on the print out
because it is on the page. Is it possible to hide that button when
the iframe is printed?

2. The printed report is essentially a table in which certain cells
have differing background colors and text colors. By default, when
the browser prints, it does not print the background colors, etc. I
can manually turn this on using the settings of the browser, but I was
wondering if there was a way to override the setting from the page
itself?

Thanks,

Chris
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top