Hey ramil,
thanks for your quick response.
We are using the offline export service.
When taking your code, and integrating it into our setup with the online export it works,
but when switching to the offline export, it doesn’t work correctly anymore.
gantt.plugins({
export_api: true,
keyboard_navigation: true,
undo: false,
tooltip: true,
multiselect: true,
marker: true,
drag_timeline: true,
});
const tasks = {
data: [
{ id: '10', text: 'Project #1', render: 'split', start_date: '01-04-2025', duration: 3, progress: 0.4 },
{
id: '1',
text: 'Task #1',
color: 'yellow',
start_date: '01-04-2025',
duration: 1,
progress: 0.6,
parent: '10',
},
{
id: '2',
text: 'Task #2',
color: '#f9dd7b',
start_date: '03-04-2025',
duration: 1,
progress: 0.6,
parent: '10',
},
{
id: '20',
text: 'Project #2',
render: 'split',
start_date: '01-04-2025',
duration: 3,
progress: 0.4,
type: 'project',
},
{
id: '3',
text: 'Task #3',
color: 'yellowgreen',
start_date: '01-04-2025',
duration: 1,
progress: 0.6,
parent: '20',
},
{
id: '4',
text: 'Task #4',
color: 'goldenrod',
start_date: '02-04-2025',
duration: 1,
progress: 0.6,
parent: '20',
},
],
links: [
{ id: 1, source: 1, target: 2, type: '0' },
{ id: 2, source: 2, target: 3, type: '0' },
{ id: 3, source: 3, target: 4, type: '0' },
{ id: 4, source: 2, target: 5, type: '0' },
],
};
gantt.locale.labels.section_split = 'Display';
gantt.config.lightbox.project_sections = [
{ name: 'description', height: 70, map_to: 'text', type: 'textarea', focus: true },
{
name: 'split',
type: 'checkbox',
map_to: 'render',
options: [{ key: 'split', label: 'Split Task' }],
},
{ name: 'time', type: 'duration', map_to: 'auto' },
];
gantt.config.open_split_tasks = true;
gantt.init('gantt_here');
gantt.parse(tasks);
gantt.exportToExcel({
visual: true,
server: getCurrentUrl(href) + ‘/export’,
callback: async function (res: any) {
console.log(‘
~ exportExcel ~ res:’, res);
await downloadFile(res, href, ‘solid-hour-gantt.xlsx’);
},
});
With the offline export service, our xlsx is just a JSON object.