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

Problems with Exporting as png file - Please help.

Asked by Dave Periam
8 years ago.

Dear Sirs,

I am having problems with getting the daypilot control to export an image..
I am getting a nullreference exception.

This is the exception message:
at DayPilot.Web.Ui.Export.SchedulerExport.DrawTimeHeaderGroups(Graphics g, List`1 row1)\r\n at DayPilot.Web.Ui.Export.SchedulerExport.GetTimeHeader()\r\n at DayPilot.Web.Ui.Export.SchedulerExport.DrawTimeHeader(Graphics g)\r\n at DayPilot.Web.Ui.Export.SchedulerExport.Export()\r\n at DayPilot.Web.Ui.DayPilotScheduler.ExportBitmap()\r\n at DayPilot.Web.Ui.DayPilotScheduler.Export(ImageFormat format)

Please would you help?

Many Thanks,

Dave

Comment posted by Dave Periam
8 years ago.

Note:

I am using version 7.7.3086.1 with .Net 4.0, Visual Studio 2010 inside of a web application project.

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Do you see this error with the latest release as well (8.1.3460)?

http://www.daypilot.org/try/

Comment posted by Dave Periam
8 years ago.

Dan,

I've tried upgrading the daypilot control - and discovered that the code I have is tied to version 7.x

The following information can be helpful to determine why the assembly 'DayPilot, Version=7.7.3086.1, Culture=neutral, PublicKeyToken=426941954f05e7fe' could not be loaded.

Any advice on how I get around that?

Thanks

Dave

Comment posted by Dave Periam
8 years ago.

Dan,

Two other issues I've just noticed:

1) Error 58 'DayPilot.Web.Ui.Events.Scheduler.EventDeleteEventArgs' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'DayPilot.Web.Ui.Events.Scheduler.EventDeleteEventArgs' could be found (are you missing a using directive or an assembly reference?)

2) Error 46 The type or namespace name 'EventDeleteEventArgs' does not exist in the namespace 'DayPilot.Web.Ui.Events' (are you missing an assembly reference?)

Any ideas on resolving these?

Thanks

Dave

Comment posted by Dave Periam
8 years ago.

NB Those recent two postings were with DayPilot v8.13460 - the latest release.

Comment posted by Dan Letecky [DayPilot]
8 years ago.

> The following information can be helpful to determine why the assembly 'DayPilot, Version=7.7.3086.1, Culture=neutral, PublicKeyToken=426941954f05e7fe' could not be loaded.

Try to remove the reference to DayPilot.dll and add it again.

> Two other issues I've just noticed:

This signature is copied from the latest release (8.1.3460) and it should work fine.

using DayPilot.Web.Ui.Events.Scheduler;

// ...

protected void DayPilotScheduler1_EventDelete(object sender, EventDeleteEventArgs e)
{
  string id = e.Id;
}

The full name of this class is DayPilot.Web.Ui.Events.Scheduler.EventDeleteEventArgs.

Also, try using e.Id instead of e.Value.

Comment posted by Dave Periam
8 years ago.

Dan,

Thanks for your assistance - I've gotten DayPilot 8 working..

However, my original issue, remains, there is still a null reference exception error:

" at DayPilot.Web.Ui.Export.SchedulerExport.DrawTimeHeaderGroups(Graphics g, List`1 row1)\r\n at DayPilot.Web.Ui.Export.SchedulerExport.GetTimeHeader()\r\n at DayPilot.Web.Ui.Export.SchedulerExport.DrawTimeHeader(Graphics g)\r\n at DayPilot.Web.Ui.Export.SchedulerExport.Export()\r\n at DayPilot.Web.Ui.DayPilotScheduler.ExportBitmap()\r\n at DayPilot.Web.Ui.DayPilotScheduler.Export(ImageFormat format)"

Would you have any thoughts?

Thanks

Dave

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Thanks - I'm checking the problem.

Do you use CellWidthSpec = "Auto"?

Comment posted by Dave Periam
8 years ago.

Dan,

Yes, that is used.

Dave

Comment posted by Dave Periam
8 years ago.

Dan,

I'm unsure of the time delay with someone (?) or you replying...
Is there any progress with this please?

Thanks

Dave

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Sorry - let me check that.

Meanwhile, you can try setting a fixed width as a workaround.

Comment posted by Dave Periam
8 years ago.

Dan,

Apologies for the delay: I looked into setting a fixed width as a workaround.. However, given the nature of the project, I really would not want to make changes at this point.

How are things coming along with your investigations, please?

Thankyou very much for your time.

Dave

Answer posted by Dan Letecky [DayPilot]
8 years ago.

The problem should be fixed now in the latest sandbox build (8.1.3468):

http://www.daypilot.org/sandbox/

The exception will not appear anymore.

The behavior is as follows:

1. If the auto cell width mode is used (http://doc.daypilot.org/scheduler/auto-cell-width/) the server-side CellWidth value is used for the calculations. The current CellWidth value dynamically calculated on the client is not used because it is not sent back to the server.

2. If you want to print the whole width set DayPilotScheduler1.Width = Unit.Percentage(100); before exporting.

This way you can control the cell size while printing the full grid.

Answer posted by Dave Periam
8 years ago.

Dan,

Many thanks for sorting that for me/us.
I confirm that the version supplied resolves the issue.

Regards

Dave

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Great, thanks for the update.

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