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.
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).