Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) convert calendar into pdf (Read 11760 times)
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
convert calendar into pdf
Dec 9th, 2012 at 9:35pm
Print Post  
What would be the best way to convert (print, export,..) a calendar into a pdf file ? (Preferably done on the webserver in a standard .NET / non silverlight environment).

Thanks,
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #1 - Dec 10th, 2012 at 9:05am
Print Post  
Currently only the reporting component of the WinForms version of the control supports exporting to PDF. You can preview a sample exported PDF attached to this post. If this suits your needs we can port the reporting functionality to the ASP.NET version so that it can be done on server-side.

Regards,
Meppy
  

sample.pdf (Attachment deleted)
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #2 - Dec 10th, 2012 at 8:20pm
Print Post  
This report is a textual representation. Is there also a graphical representation of the calendar in pdf possible ?
Thanks,
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #3 - Dec 11th, 2012 at 12:58pm
Print Post  
We have implemented a WYSIWYG PDF export in the WinForms version of the Scheduling component. To export to a PDF file you can use the WinForms Calendar control on the server-side of a Silverlight application, as illustrated by the sample below:

https://mindfusion.eu/_samples/_sample_pdfexport.zip

Note that the exporting is heavily dependent on the view settings. The sample does not transfer any view properties from the client to the server (except Width, Height, CurrentView, and Theme). If you need to specify additional view settings on the client, you have to either transfer those as well or hardcode them in the server-side calendar.

Sample result of the exporting can be observed below:

http://mindfusion.eu/_samples/sample2.pdf

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #4 - Dec 14th, 2012 at 8:24am
Print Post  
Thanks, this is already a big step in the solution for my problem.
One last question. I was already using PdfSharp for the creation of pdf docs on the webserver. Is there a way to merge the pdf calendar into a pdfsharp doc ?
Or perhaps I would better export the calendar to another format (bitmap,....) that I can use in pdf sharp ?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #5 - Dec 14th, 2012 at 9:25am
Print Post  
It appears that PDFsharp supports PDF merging, according to this link. Additional information on how it is done can be found here.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #6 - Dec 18th, 2012 at 9:31pm
Print Post  
OK, I am trying to use your example in my test project.
However on the Silverlight client I had defined an ItemPresenter for an Appointment derived class so that specific appointments had a custom style.
The ItemPresenter refered to a style defined in the App.XAML file.
How can I do this on the server side ? (where there is only Winforms support and no XAML ?)

Thanks again.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #7 - Dec 19th, 2012 at 6:22am
Print Post  
You can use custom drawing (or custom item viewers) in order to resemble the custom item presenters on the client. I may help you with the specifics if you provide me with the item presenters' style.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #8 - Dec 19th, 2012 at 7:20pm
Print Post  
OK. I've found an example on creating an ItemViewer and implementing the Draw function. That seems to do the trick indeed !
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #9 - Mar 2nd, 2013 at 11:21am
Print Post  
I'm still using this winforms version on the backend of my silverlight site, however I get an exception when saving the schedule to XML.
NullreferenceException in the WriteCustomBrushes function.
I don't know about custombrushes, what should i do to prevent this exception ?
Thanks,
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #10 - Mar 3rd, 2013 at 11:25am
Print Post  
I am not able to reproduce the exception with this version. Try using the latest WinForms build below:

https://mindfusion.eu/_temp/MindFusion.Scheduling.5.4.4.trial2.zip

If the exception still happens, please, provide me with the full stack trace and, if possible, the XML of the calendar serialized on the client side.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #11 - Mar 3rd, 2013 at 8:42pm
Print Post  
I also get the exption with this version:

   bij MindFusion.Scheduling.XmlSerializationContext.WriteCustomBrushes(CustomBrushes customBrushes, String elementName, XmlElement parentElement)
   bij MindFusion.Scheduling.Resource.SaveTo(XmlElement element, XmlSerializationContext context)
   bij Trainers.Web.Calendars.Trainer.SaveTo(XmlElement element, XmlSerializationContext context) in C:\trainers\Trainers\Trainers.Web\Calendars\Trainer.cs:regel 23
   bij MindFusion.Scheduling.XmlSerializationContext.xe8bc3e7f9bd73a52(Resource x41c4b132ee719a30, XmlElement x1ea18269223b2a9c, String x121383aa64985888)
   bij MindFusion.Scheduling.Schedule.SaveToXml(XmlDocument document)
   bij Trainers.Web.Services.Service1.SyncWithGoogleCal(_vwCalendar cal) in C:\trainers\Trainers\Trainers.Web\Services\Service1.asmx.cs:regel 820
   bij Trainers.Web.Services.Service1.GetCalendarData(Guid id) in C:\trainers\Trainers\Trainers.Web\Services\Service1.asmx.cs:regel 766

I used a custom resource class (Trainer, inherits from resource), in the SaveTo(Xml) of the base (resource class) is where the exception occurs.

Thanks,
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: convert calendar into pdf
Reply #12 - Mar 4th, 2013 at 8:07am
Print Post  
Please, try again with this version:

https://mindfusion.eu/_temp/MindFusion.Scheduling.5.4.4.trial3.zip

Regards,
Meppy
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: convert calendar into pdf
Reply #13 - Mar 4th, 2013 at 5:17pm
Print Post  
OK Thanks, the issue seems to solved !
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint