Link to home
Start Free TrialLog in
Avatar of Drakecoldwinter
Drakecoldwinter

asked on

asp:calendar and window.print();

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 ?
ASKER CERTIFIED SOLUTION
Avatar of muzzy2003
muzzy2003

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Drakecoldwinter
Drakecoldwinter

ASKER

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
Sorry the answer wasn't closer to what you wanted, but glad to help.
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.
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 ;
}}
Excellent. And I've learned something too. That's why I'm here, really!
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.

EDIT:
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:

http://support.microsoft.com/kb/974128