Hi
I am currently trying to replace the 'Export to Excel' function with a 'Export to OpenOffice' function. Pasting data of the clipboard to OpenOffice already works. I would like to use the code of the 'Export to Excel' function which copies the grid data to the clipboard (kernel side). So is there any way to call that function or a workaround?
It is also no option to modify SysGridExportToExcel
because the Export to Excel Button which copies the grid data to the clipboard and then proceeds to call performPushAndFormatting
is deactivated if there is no Excel installed (also kernel side).
*This post is locked for comments
Hi Denis,
I don't need to intercept the "export to Excel" command, because the kernel side logic should be executed. I'll then check in SysGridExportToExcel if OpenOffice is installed.
Where would you search for the logic if Excel is installed or how should I intercept it?
Hi Joey
You can try to modify the SysSetupFormRun class, Task method and intercept the "export to Excel" command.
I think you will be able to intercept also if Office isn't installed.
Finally, call a new custom class that handle the Export Open office using COM objects
Hi Joey,
You are right. I missed the AX 2009 tag. Here it is more part of the kernel compared to AX 2012. The toolbar is predefined.
I don't have an answer to activate it without installing Excel.
You can try to create a total new feature, but this will not be part of the toolbar.
I am using AX 2009. When I click on the button nothing happens.
This applies on any form.
Hi Joey,
I don't experience the problem where the Export to excel is deactivated. I have checked AX 2012 and AX 2012 R3. When I then click the button, it will ask me to find an app in the store...
So I wonder why your button is not enabled. Please check it on e.g. the Main accounts list page. Please tell which form you used for testing this.
Hi André,
thanks for your help.
You made some good point, but a problem is that the 'Export to Excel' is deactivated, if there is no Excel installed. I didn't find any way to change this.
And another thing, 'isExcelInstalled' is never called (atleast not in accessible code) and changes didn't affect the outcome.
Hi Joey,
I wonder if anyone has the experience. In fact you have to deal with some logic that is build in the kernel.
The command button action is a kernel option. Some logic have been made available to have users customize some formatting.
You can try to change or add logic in several methods of the SysGridExportToExcel. There are methods called 'isExcelInstalled' and 'focusExcel'. You have to look at these as well.
It might be an idea to add a parameter or user option with an enum which program to use: Excel or OpenOffice.
Then based on this enum execute the standard logic or your new created OpenOffice interface. I don't know if you can call Open office using COM objects.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156