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.
Answer posted by Dan Letecky [DayPilot] 1 years 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 1 years 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.
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] 1 years 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 1 years 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] 1 years 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 1 years 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 month old and has been closed. Please create a new question if you have anything to add.