asp:calendar and window.print();

Posted on 2006-11-09
Last Modified: 2013-12-03
I have a strange bug, I have a page with a asp:calendar control, I do plenty of
e.Cell.BackColor = System.Drawing.Color.Orange
to put colors in the days of the calendar, I end up with a pretty colorfull calendar. Then I do a window.print(); with javascript and it prints blank calendars... all the colors dissapear on the printing, I simply don't understand the reason of this behavior but I need to print that calendar.

Help please ?
Question by:Drakecoldwinter
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 16

Accepted Solution

muzzy2003 earned 350 total points
ID: 17909701
This is down to the printing in the browser. In IE, there is an option under Printing in the advanced options to enable background colour printing, but it's off by default.

Author Comment

ID: 17909825
Well, I got an easy and concrete answer that works well, so I will consider myself kind of happy with it. Now I have the whole background also printing wich I don't truly wish, but at the very least the calendars print, so I give you the points. thanks
LVL 16

Expert Comment

ID: 17909841
Sorry the answer wasn't closer to what you wanted, but glad to help.
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

ID: 17909869
Well I wished to print the calendars with all the colors, now it works. The background is heavy and deranges the print through, but I found something about CSS @media print that I can use to maybe take off the background. At the very least now it's functional and I can print those calendars, so is just a look matter for the background. But your answer was 100% acurate.

Author Comment

ID: 17909910
I'm a happy man now, for further reference this has solved all my troubles and print a beautifull page with colorfull calendars and no background, thanks muzzy2003 :

@media print {
            BODY {background-color : White ;}            
 @media screen{
      BODY {
      background-color : #003366;
      background-image : url(images/backgnd2.jpg);
      background-repeat : repeat-x ;
LVL 16

Expert Comment

ID: 17909931
Excellent. And I've learned something too. That's why I'm here, really!

Expert Comment

ID: 38554187
Hi all,

I'm running into the same issue that Drakecoldwinter was having, but enabling Print background colors and images isn't fixing the issue.  Given that this thread is from 2006, I was wondering if different settings needed to be tweaked using IE 8?  If anyone has any ideas they would be greatly appreciated.  Thanks so much.

Just in case someone comes along with a simlar problem.  In IE 8, there is another setting that needs to be checked.  See this kb article for details:

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calculating percentage 2 45
c#, datatable, aspx 4 46
How to set up WAMP on a windows 8.1 IIS machine 14 43
bulk load multiple users for aspnetusers table 2 11
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question