Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Printing calendar in single month view (Read 3520 times)
bpeacock
YaBB Newbies
*
Offline


War Eagle!

Posts: 14
Joined: Mar 8th, 2007
Printing calendar in single month view
Mar 13th, 2007 at 3:07pm
Print Post  
I am trying to print a date range while the calendar is in single month view.  I would like to be able to print automatically all the months for a given start date and end date.  Currently, I can only print the current month.  I was able to create a routine that loops through a given date range and switches the calendar to each month then fires the calendar.print() method.  The only problem is the print dialog pops up every time the month changes and the print method is fired.  Users won't like that.  Ideas would be greatly appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing calendar in single month view
Reply #1 - Mar 13th, 2007 at 4:29pm
Print Post  
Try using the void Print(PrintDocument doc) overloaded method. It won't display a dialog but just use the printer specified in doc.PrinterSettings. By default that's the system default printer, but you can change it if you wish.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
bpeacock
YaBB Newbies
*
Offline


War Eagle!

Posts: 14
Joined: Mar 8th, 2007
Re: Printing calendar in single month view
Reply #2 - Mar 14th, 2007 at 3:31pm
Print Post  
That worked fine.  Thanks for the help
  
Back to top
 
IP Logged
 
Charliemouse
YaBB Newbies
*
Offline



Posts: 4
Joined: Dec 5th, 2006
Re: Printing calendar in single month view
Reply #3 - Apr 2nd, 2007 at 12:56pm
Print Post  
Hi.  I'm having a similar problem, but printing a range of days as individual timetables.

Using the Print(PrintDocument doc) overload works to an extent but if, for example, I wanted to print a week as 7 pages, it would generate 7 individual print jobs, each with a dialog box saying "Printing page 1 of 1".  This is even more problematic when printing to file, as the user is prompted 7 times.

A solution would be to change the Calender's BeginPrint, PrintPage and EndPrint methods from private to protected virtual (so Calendar could be overriden) or public (so it could be manually attached to a PrintDocument).  The first solution is probably more OO, certainly considering that being able to extend the Calendar component via inheritance is a desirable feature.

Or is there another way around this that I have totally overlooked?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Printing calendar in single month view
Reply #4 - Apr 2nd, 2007 at 1:27pm
Print Post  
We will consider making the print methods in the Calendar class protected virtual in the next release.

Meppy
  
Back to top
 
IP Logged
 
Charliemouse
YaBB Newbies
*
Offline



Posts: 4
Joined: Dec 5th, 2006
Re: Printing calendar in single month view
Reply #5 - Apr 3rd, 2007 at 8:14am
Print Post  
Cool.  8)

I think that should do it - an inheriting class could then intercept the begin, page and end messages from a PrintDocument and perform custom processing, such as moving the component onto the next day between pages.  A little more access around printing would definitely enhance the component.

Cheers.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint