Our pure JavaScript Scheduler component


Post by ashupp »

Hello,

during configuration of excel export i came up to this issue.

None of the configuration of the columns (resource or event) seem to change anything in the generated file.
However - the dateFormat is changed to the desired.

Easy to reproduce in the Example:
https://www.bryntum.com/examples/examples-scheduler/exporttoexcel/

  • Open example and insert additional test export button below.
  • Click on Export Test and check exported file.
  • As result i would expect to have only StaffTest as resource and the Column TaskTest for events. Also the width of the TaskTest column should be respected. None of it is the case but the file is generated with default options (except dateFormat)
                {
                    type     : 'button',
                    text     : 'Export Test',
                    ref      : 'excelExportBtn3',
                    icon     : 'b-fa-file-export',
                    onAction : () => scheduler.features.excelExporter.export({
                        filename        : 'Export with column configuration not respected',
                        dateFormat      : 'DD.MM.YYYY HH:mm',
                        resourceColumns : [{ text : 'StaffTest', field : 'name' }],
                        eventColumns    : [
                            { text : 'TaskTest', field : 'name', width : 800 },
                        ]
                    })
                },

Is this actually a bug or a wrong expectation or configuration from my side?

Best regards, Alex


Post by Maxim Gorkovsky »

Hello.
Reproduced, ticket opened here: https://github.com/bryntum/support/issues/1763 Thank you for report.

Demo shows incorrect configuration of the exporter. According to the docs it should be like this:

scheduler.features.excelExporter.export({
    filename       : 'Bar',
    exporterConfig : {
        columns      : [{ text : 'Foo', field : 'name' }],
        eventColumns : [
            { text : 'Task', field : 'name', width : 200 }
        ]
    }
});

Post by ashupp »

Hello and thank you for the fast response,

first of all: thank you - it works when i am using the configuration schema you provided .
But i started implementing using the docs and then went to the examples because i did not work.
I also noticed the difference on columns vs resourceColumns and tried both before reporting.

But i think the fact that "exporterConfig" is needed is currently still missing in this doc:
Because when using the snippet shown at "Here is an example of how to add the feature:" exporterConfig is not used and therefore it seems not to work .
https://www.bryntum.com/docs/scheduler-pro/#Scheduler/feature/experimental/ExcelExporter

However - i found that in the grid doc of the excelExporter is the exporterConfig in the snippet:
https://www.bryntum.com/docs/scheduler/#Grid/feature/experimental/ExcelExporter

Thanks and Best regards, Alex


Post by ashupp »

Hello,

during further implementation i stumbled across another potential issue.

When using the Grouping feature in combination with configured exporterConfig columns the Group headers in resulting excel file are not shown.

This can also be reproduced in the example mentioned above by simply adding group: 'role' to the features.
(And of course change resourceColumns to columns :D )
As soon as columns are configured - the group headers are not set in the excel file but empty rows are displayed instead.

Could this be a configuration issue on my side?
How can the Group headers be modified for export or set with custom columns configuration?

Thank you


Post by alex.l »

Hi Alex,

We will fix our docs asap, thanks for your notification.
I just tested it with our examples (https://bryntum.com/examples/examples-scheduler/exporttoexcel/) using the next configuration:

                    scheduler.features.excelExporter.export({
                        filename        : 'Export with column width specified',
                        exporterConfig : {
                            // Choose the Resource fields to include in the exported file
                            resourceColumns : [{ text : 'Staff', field : 'name' }],
                            // Choose the Event fields to include in the exported file
                            eventColumns    : [
                                { text : 'Task', field : 'name', width : 200 },
                                { text : 'Starts', field : 'startDate', width : 200 },
                                { text : 'Ends', field : 'endDate', width : 200 }
                            ]
                        }
                    })

And added to features:

group: 'role'

See an image with the result in attachments.

All best,
Alex

Attachments
Screenshot 2020-11-03 at 14.10.33.png
Screenshot 2020-11-03 at 14.10.33.png (238.09 KiB) Viewed 772 times

All the best,
Alex


Post Reply