Hi, I'm using a clone of [OutSystems Data Grid] Forge component Version 2.12.1 for Reactive app.
For CSV file export, the below code is working. OutSystems.GridAPI.GridManager.GetGridById($parameters.Grid).features.export.exportToCsv($parameters.FileName)
But I need to export the data from the grid as an Excel file. We have a separate block for the export button. I've used the following code,
OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.export.exportToExcel($parameters.IncludeStyles, $parameters.FileName);
* IncludeStyles parameter is set as True.
But this is not working as expected. And I get an error. Can anyone, please help me with this?
Thanks in advance,
Rajasree Padmanaban
Hi Rajasree try to remove the style parameter and then try.
Hi Yashpal, Thanks for your suggestion.When I remove the Style Parameter it returns Assertion Failed Error.
Hi Rajasree,
Try using this in your JS, It worked for me.
GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.export.exportToExcel($parameters.IncludeStyles, $parameters.FileName);
Hope it helps,
Thanks
Hi Jozy, Thanks for your suggestion.But it returns the error
Can you please share your JS code as this code is working fine for me.
I am sharing the working example please have a look.
https://jozy-sohail.outsystemscloud.com/testJS/datagrid?_ts=638375551554869100
also attaching an updated OML for reference. Check the datagrid screen
Hi Jozy, Thanks for your SampleOML. And it's working fine.But I'm having doubt that, I'm using the previous version of [Outsystems Data Grid], and without updating it to the latest version can we use this code. Does this works? If yes, It would be very helpful for me.
I am sorry but I haven't tried with the previous version, you need to try and check.
Thanks.
Ok Jozy. Thanks for your valuable time.
I am glad to help :)
If this solved your issue please mark it as a solution so that it will be easy for our fellow developers to find the solution for same problem.
Regards,Jozy
Hi @Rajasree Padmanaban
please check and verify on the widget tree of that screen if you find the desirable variable "hidden" somewhere behind an "if" condition or something like that.
I had that issue before with one of JS and it was that situation.
Hope this helps somehow, good luck!
Cheers!