DHTMLX / gantt

GPL version of Javascript Gantt Chart
https://dhtmlx.com/docs/products/dhtmlxGantt/
GNU General Public License v2.0
1.44k stars 320 forks source link

Cannot read custom columns from MPP imports #90

Open AntoRin opened 1 year ago

AntoRin commented 1 year ago

I am using the following block of code to import MPP files:

gantt.importFromMSProject({ data: file, taskProperties: ["Notes", "Name", "Start", "Finish", "Start1", "Finish1"], callback: function (project) {}...

Given that "Start", "Finish", "Start1", "Finish1" are all names of columns in the MPP file. But after import, the properties "Start1" and "Finish1" happen to be null, while the properties "Start" and "Finish" happen to be time in hours - although the file clearly has dates.

gearcoded commented 1 year ago

@AntoRin, The Start1 and Finish1 properties are not supported: https://docs.dhtmlx.com/gantt/desktop__tags.html#tasksproperties The dev team will try to add it in the future, but I cannot promise that.

Regarding the Start and Finish properties - it is a bug. The dev team will fix it in the future, but I cannot give you any ETA.

As a workaround, you can obtain the Start and Finish properties from the $raw parameter: https://snipboard.io/56hQKJ.jpg

AntoRin commented 1 year ago

@AntoRin, The Start1 and Finish1 properties are not supported: https://docs.dhtmlx.com/gantt/desktop__tags.html#tasksproperties The dev team will try to add it in the future, but I cannot promise that.

Regarding the Start and Finish properties - it is a bug. The dev team will fix it in the future, but I cannot give you any ETA.

As a workaround, you can obtain the Start and Finish properties from the $raw parameter: https://snipboard.io/56hQKJ.jpg

I am not only talking about start1 and finish1 properties. Let's say there's a column in the MPP called "totally_custom_column".

Is there a way to read the values for this column using .mpp import?

gearcoded commented 1 year ago

@AntoRin, To import custom properties, you need to specify them in the taskProperties paramerter, then load them from the $custom_data property: https://docs.dhtmlx.com/gantt/desktop__export_msproject.html#importfrommsproject:~:text=Getting%20tasks%20properties

Some of them will be imported, but there is no way to tell which properties will work.

We use the MPXJ library to convert files, and when it doesn't return a custom property from a file, we cannot do anything there. And it works differently for MPP and XML file, so, if you cannot import it from the MPP file, you can try the XML file, and vice versa: https://snipboard.io/0MSzY9.jpg

When I checked the totally_custom_column the data was imported: https://snippet.dhtmlx.com/dw8lx21a