Excel export not working for large size data

excel export not working for large size data

Hello Prakash,
It can happen because of the following reasons:

  1. When you export the data, Gantt saves all your tasks and sends them in a request to the export server. If you use our online export server, the request size is limited:
    https://docs.dhtmlx.com/gantt/desktop__export.html#limitsonrequestsize

  2. There is an issue with export functionality. We are aware of that, and it will be fixed in the future. I cannot give you any ETA, but I will notify you when the issue is fixed.

However, please, reproduce the issue in the snippet so that I can be sure why it happens in your case:
http://snippet.dhtmlx.com/ffd5a0bbd
After adding your configuration, make sure that the issue is reproduced, then click on the “Share” button and send me the link.

Hi Ramil,

We’re also having issues with our Export to Excel. I see it only happens when visual is set to true, but that’s exactly what we want to export.
When do you expect to have a solution for this?

Thanks,

Maurice

Hello Maurice,
Unfortunately, I cannot give you any ETA.
The issue should occur when you export without the grid or specify tasks in the data parameter.
As a workaround, you can export when the grid is enabled and do not use the data parameter.
If you have a different use case, please reproduce the issue in the snippet and send it to me and I will check what might be wrong there.

I’m using this code to call the export, with some custom header names etc.

gantt.exportToExcel({
				name: "SPS_export.xlsx",
				columns: [{
						id: "id",
						header: spsLabels.column.workorder,
						width: 130
					},
					{
						id: "desc",
						header: spsLabels.column.description,
						width: 230
					},
					{
						id: "start_date",
						header: spsLabels.column.start_date,
						width: 120,
						type: "date"
					},
					{
						id: "status",
						header: spsLabels.column.wostatus,
						width: 150
					},
					{
						id: "wotype",
						header: spsLabels.column.wotype,
						width: 120
					},
					{
						id: "prioritydesc",
						header: spsLabels.column.wopriority,
						width: 130
					}
				],
				visual: true,
				cellColors: true

It’s working without the “visual: true”. With the parameter set to true, even with just 1 task (check for limit on large request size) it’s not working.

Where can I create a snippet?

Thank you.

Hello Maurice,
I cannot reproduce the issue when I add your export configuration:
http://snippet.dhtmlx.com/5/03bb19a13

If you export the data with the timeline activated and don’t use the data parameter in the export function, the issue might be related to something else, but it is hard to suggest what might be wrong. You can modify the code in the snippet above to reproduce the issue, then click on the"Share" button and send me the link.

Hi,

I’ve managed to capture the network traffic to the export API, see attached file.

The error it returns (in the background on the API call) is:

TypeError: Cannot read property ‘$level’ of undefined

Please have a look at this. Thank you.

excel_export_issue-data.json (14.3 KB)

Hello Maurice,
Thank you for sending the JSON data.
Looks like the issue occurs because of the $color and $end properties:
http://snippet.dhtmlx.com/5/969d2a47d

If you use those properties in your task data, you need to avoid using the properties that start from $ as these properties are considered as the system and temporary ones.
If you don’t use those properties, it means that Gantt added them when saving the task data in a request string.
I need to reproduce the issue from the initial data to see what might be wrong.

Hi Ramil,

I don’t have a property “end” but I do have a property “color”. Removed that from the data but still getting the same error.

I can’t use/test the snippet as the server address to me is incorrect.

Hello Maurice,
Here is the updated snippet where I commented the server option:
http://snippet.dhtmlx.com/5/1cf4d6dc1

However, without a snippet where I can reproduce the issue locally, it is hard for me to suggest what might be wrong.

Hi ramli,

I have the same issue as Maurice, and I only have the issue with a scale of height 2, and 2 arrays in the scales data array.

I hope this could help.

Hello Louis,
Thank you for the clarification.
Looks like the issue occurs if you have several scales and try to export the data with the visual: true parameter:
https://snippet.dhtmlx.com/5/c53df73c4:

We have a similar bug in our internal tracker, and it is related to custom zoom settings. Now it is clear, that the export server doesn’t know how to export several scale cells into one Excel cell. I updated the bug description. The dev team will fix it, but I cannot give you any ETA.

As a workaround, you can:

  1. backup the scale settings;
  2. change the gantt.config.scales parameter;
  3. exporting the data;
  4. revert the changes.

Here is the snippet:
http://snippet.dhtmlx.com/5/8c139c898

Hello everyone,
The Dev Team fixed the bug with the Excel export. Now, you can have different scale settings and export the data with the visual: true parameter.
You can check how it works in the following snippets:
http://snippet.dhtmlx.com/5/c53df73c4:
http://snippet.dhtmlx.com/5/0bb4afd2b