search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Export the Calendar to a Bitmap either with API or a special printing page

Asked by Mike
11 years ago.

Hello!

Every example when it comes to export the Calendar to an image is trigged with a button click event from a page where the Calendar is allready rendered.

I have tried to export the grid on Page_Load but then I always get an server error like "Only 0+ values accepted."

How should I do If i want to export the grid on pageload? Or without an button click? Or better directly via the API

The situation is like this.
I want a function that make an export function where I want to export an image of the calendar for three weeks into the future. So I have an "loop" on another page than I have the Calendar on and then I want the CalendarImage.aspx page to generate the Stream/Bitmap so that I can grab the result from.


http://booking.mydomain.com/Admin/Generate/CalendarImage.aspx?ExportDate=2010-10-18
http://booking.mydomain.com/Admin/Generate/CalendarImage.aspx?ExportDate=2010-10-25
http://booking.mydomain.com/Admin/Generate/CalendarImage.aspx?ExportDate=2010-11-01

/Mike


Comment posted by Mike
11 years ago.

I have now got an answer from the Daypilot support. So I put the answer here in case that someone else got this issue.

"
This seems to be a bug. The Export() method tries to to read the current scrollbar position. If the DayPilotCalendar is used just for export on a separate page (like in your case) the scrollbar position can't be read and is set to -1.

You can also try this call as a workaround:
MemoryStream img = DayPilotCalendar1.Export(ImageFormat.Png, 0);

"

/M

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.