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

[Excel export] Cannot merge already merged cells

Asked by Leo
1 month ago.

Hi there,

We have implemented the Excel export functionality using ExcelJS for DayPilot.Gantt.
On some charts, the exports fail with the error “Cannot merge already merged cells“. We could however not find the common denominator yet.

Do you have any ideas?

Cheers
Leo

Answer posted by Dan Letecky [DayPilot]
1 month ago.

Hi Leo,

Most likely, it‘s related to the row headers (number of columns, column titles…). You can also try posting the error stack trace.

Comment posted by Leo
20 days ago.

Hi Dan,

Apologies for the late reply - I was trying to find out exactly when this happens. I seem to have the issue in the Gantt only when I have scale = “Week” set.

I set:

gantt.scale = 'Week';
gantt.cellWidth = 100;
gantt.useEventBoxes = 'Never';
gantt.cellDuration = 1440;
gantt.cellGroupBy = “Month“;
gantt.cellWidth = 100;
gantt.cellWidthSpec = “Fixed“;

And have two headers:

  • A month header (level 0, groupBy = “Month“)

  • A week header (level 1, groupBy = “Week“)

The call stack is:

at exceljs.js?v=3f5eaafe:2040:44
at exceljs.js?v=3f5eaafe:2612:13
at Array.forEach (<anonymous>)
at Object.each (exceljs.js?v=3f5eaafe:2611:71)
at t.exports._mergeCellsInternal (exceljs.js?v=3f5eaafe:2039:15)
at t.exports.mergeCells (exceljs.js?v=3f5eaafe:2031:18)
at o3.setColspan (daypilot-pro-javascript.js?v=3f5eaafe:2144:37)
at daypilot-pro-javascript.js?v=3f5eaafe:15922:326
at Array.forEach (<anonymous>)
at daypilot-pro-javascript.js?v=3f5eaafe:15916:30

Comment posted by Dan Letecky [DayPilot]
17 days ago.

Hi Leo,

Does it happen when you use this instead?

useEventBoxes: 'Always'

This is necessary because the events need to be aligned with the grid during Excel export.

Comment posted by Leo
16 days ago.

Hi Dan,

yes, it happens with “Always” as well.

FYI, I have other Gantt charts where useEventBoxes is set to “Never” and the issue doesn’t arise there…

Comment posted by Dan Letecky [DayPilot]
15 days ago.

Thanks.

1. The latest sandbox build (2025.3.6635) includes a fix for export with area: "viewport" option. If that is your case, you can give it a try.

2. Could you please post a screenshot of the code location marked as the source in the stack trace (“at daypilot-pro-javascript.js?v=3f5eaafe:15916:30”)?

Comment posted by Leo
15 days ago.

Hi Dan,

We use area: "full" .

Here’s the screenshot:

… and just in case, also for daypilot-pro-javascript.js?v=f9e91228:15922:326

… and o3.setColspan

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