Exporting Gantt Chart image bytes

With Gantt Chart Light Library (GCLL) for WPF (and the older Project Management Library) it’s very easy to export PNG or other types of images and save their content bytes to custom files or streams for any purposes.

However, once you moved to our JavaScript® and/or ASP .NET components provided by Gantt Chart Hyper Library (GCHL) for HTML5 (or Gantt Chart Web Library wrappers), you may have found out that exporting is now available only as HTML content, using SVG for the chart area, and that browsers have a hard time to actually save that to a file or print them properly.

To address the problem, the fastest way we can get you with a server side export Gantt Chart image function was to add it to our Project Management Framework (PMF) library. That is essentially a .NET based API with no user interface that may be used to manage tasks as in a GanttChartView UI component, so we thought that the export image function fits well there. Moreover, PMF’s TaskManager supports Microsoft Project® XML transport format for its loaded data, and so do our other products.

Eventually, we created a new GanttChartExporter component (available in a separate assembly – DlhSoft.ProjectData.Core.Imaging.dll) within PMF, that allows you to pass a TaskManager object and receive bytes representing the contents of a Gantt Chart image for the managed tasks.

Although the API is very simple, you should however know that in order to actually generate the image we internally used GCLL assemblies. But don’t worry: we don’t require you to purchase a separate license for that product, if you have a license for PMF. And if you don’t have a PMF license, you can get one with 20% discount if you already have another product from us (for the same license type) – please just contact us in this case!

In conclusion, you can now use GCHL on the client side in conjunction with PMF on the server to be able to actually retrieve image bytes (and serve as a download) for the client side Project XML data easily:

  • Call GCHL’s GanttChartView.getProjectXml() on the client side to get the Project XML content;
  • Pass that content to your server side;
  • Create a PMF TaskManager on the server side, and call taskManager.LoadProjectXml(data) method there;
  • Finally, respond to the client with the new PMF‘s GanttChartExporter.GetSimpleImageBytes(taskManager) result – it will be a PNG image that can be easily displayed or printed on the client side!

Of course, we also have a GanttChartExporter.GetImageBytes(taskManager, configuration, […]) method that allows you to configure the exported image further, including by setting up the grid columns, chart scales, zoom level and bar appearance settings you need (as for GCLL exporting, since that is the internal implementation we use.) See this sample to understand how you can use GanttChartExporter with a custom configuration for the exported image (it requires PMF 5.0.4 or later).


About DlhSoft Team

DlhSoft is a software development company focused on building high quality and innovative solutions using state-of-the-art technologies for customers worldwide. Our activity includes designing and developing general purpose software applications, components and tools, and customized software solutions upon request. DlhSoft team is highly experienced and fully dedicated to software development. Additionally, one of the most important things we rely on is the continuous communication with the customer.
This entry was posted in Development Components and tagged , , . Bookmark the permalink.

Add a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s