Hello,
I am using this JavaScript to export the excel (only visible column ) in Data Grid.
GridAPI.GridManager.GetGridById($parameters.Grid_Id_selected).features.export.exportToExcel($parameters.IncludeStyles, $parameters.FileName);
but Excel is looking like this
I tried to pass IncludeStyle parameter value as false but it didn't work.
Is there any other approach to remove the style.
I want Excel like below one.
Thanks.
Hello @Shrinjala Singh,
Just notice my last message failed.
To do this I tested and worked correctly doing the following:
Hope it helps.
Cheers,GM
Just to be clear, you want to remove the padding of the cells or is it the row header?
Hi Gabriel,
I want to remove padding from cell.
Hi @Shrinjala Singh,
Could you please share an example of your spreadsheet?I tried to replicate that but it seems to be working as expected.
Hi @Gonçalo Martins
I have attached the oml please check that
I took a look and there are no customizations in the code related to any styling nor weird chars in the data set being used, so I guess is just something on the xlsx side that might have a default cell height. Even though this has no impact on the functionality since the function generates the spreadsheet without styling and that is the end result. It seems to look at the row height in the Grid.
One thing you can try to do is to write your own export to Excel and before calling the save() method override the height value for all rows on this object:
Let me know if it works!
Any update on this? I was able to make it work, can you provide feedback so that this can be marked as solved and hopefully be helpful to other community members.
Hi @Gonçalo Martins,
Thanks for your solution, It is working fine.
I have one more issue
In data grid I have Number and Checkbox column and that column is also getting exported in Excel. So is there any way we can remove those two columns from Excel.
Thanks
Shrinjala
Hi @Shrinjala Singh
You can use a similar approach as here and the documentation can be from here in Wijmo.
Hi @Gonçalo Martins ,
Thanks for your help.
Hi @Gonçalo Martins the first column doesn't have name. How we can remove from the export as this is something that library make automatic?
Thanks, Paulo Torres
Hello @Paulo Torres
That column is the row header so is not supposed to have a column title.If you're using the latest versions of Data Grid and you want to remove that column you can override the exportToExcel API function in the Data Grid block initialize event and add the following to the parameters that by default are set to true:
includeRowHeaders: false,
Thanks a lot Gonçalo :)
Hello @Gonçalo Martins,
There is an option to add columns? For example if I'm presenting 5 column in the Grid but I want to export 10 columns. It is possible?
I'm not aware of that. I know you can select the ones you want from the available bindings (I already shared that on another forum post) but the ones that are not present I don't know.Have you looked at Wijmo's Flexgrid documentation in order to see that? If not, I would suggest you to do that.
Thanks @Gonçalo Martins.
I managed this with event OnFiltersChange to create the filters and after I sent the filters for a different query. Just to let you know :)