163
Views
5
Comments
Solved
[OutSystems Data Grid] Remove certain columns when exporting DataGrid to Excel
Question
outsystems-data-grid
Reactive icon
Forge asset by OutSystems

I am wanting to exclude certain columns when a user exports the DataGrid to Excel. I assume I need to include more within the JS I am using to do this which is:

GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.export.exportToExcel(true, $parameters.FileName);

btw where can I find documentation on this and the other DataGrid APIs?

I see in the web component this post gave a hint but this does not seem applicable to the Reactive version?
https://www.outsystems.com/forums/discussion/79965/how-to-export-excel-without-hidden-columns-in-data-grid-web/

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hello @Nicholas Campbell 

You can find a possible solution for this use case in this post.

Cheers,
GM

2022-11-02 07-18-33
Nicholas Campbell

Thanks Gonçalo this looks like what I need.

Is there a plan to make this a part of the DataGrid - do we have an idea logged for it that you know of?

2022-11-12 11-28-30
Gonçalo Martins
Staff

At this time we don't have enough demand to justify adding it to the product (and it can be achieved through extensibility using the APIs directly from Wijmo) but it is under our radar since this is the second time someone asks for it. 

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @Nicholas Campbell 

I took the time to create a sample, maybe you can find it useful (the first column that is exported is the row header and that one for now is not possible to remove per Wijmo's limitation).

Cheers,
GM

DataGrid_ExcelColExport.oml
2022-11-02 07-18-33
Nicholas Campbell

I found where these APIs can be found, but have not seen anything yet on how to exclude/include specific columns. Perhaps this will need to become an idea if there is no existing method.

https://www.outsystems.com/forums/discussion/86866/outsystems-data-grid-where-to-find-datagrid-apis/

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hello @Nicholas Campbell 

You can find a possible solution for this use case in this post.

Cheers,
GM

2022-11-02 07-18-33
Nicholas Campbell

Thanks Gonçalo this looks like what I need.

Is there a plan to make this a part of the DataGrid - do we have an idea logged for it that you know of?

2022-11-12 11-28-30
Gonçalo Martins
Staff

At this time we don't have enough demand to justify adding it to the product (and it can be achieved through extensibility using the APIs directly from Wijmo) but it is under our radar since this is the second time someone asks for it. 

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @Nicholas Campbell 

I took the time to create a sample, maybe you can find it useful (the first column that is exported is the row header and that one for now is not possible to remove per Wijmo's limitation).

Cheers,
GM

DataGrid_ExcelColExport.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.