Solved

asp:calendar and window.print();

Posted on 2006-11-09
7
471 Views
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 ?
0
Comment
Question by:Drakecoldwinter
  • 3
  • 3
7 Comments
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 350 total points
Comment Utility
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.
0
 
LVL 2

Author Comment

by:Drakecoldwinter
Comment Utility
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
0
 
LVL 16

Expert Comment

by:muzzy2003
Comment Utility
Sorry the answer wasn't closer to what you wanted, but glad to help.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:Drakecoldwinter
Comment Utility
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.
0
 
LVL 2

Author Comment

by:Drakecoldwinter
Comment Utility
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 ;
}}
0
 
LVL 16

Expert Comment

by:muzzy2003
Comment Utility
Excellent. And I've learned something too. That's why I'm here, really!
0
 

Expert Comment

by:sheldondbrown
Comment Utility
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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now