web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Export specific data using Export to Excel option

(0) ShareShare
ReportReport
Posted on by

Hi,

I have multiple tabs in a detail form and each tab will have Export to excel option. Each fast tab has grid.

I have requirement to export selected record from a grid on the current tab to excel.


Please guide how can i achieve this.

Thanks

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Export specific data using Export to Excel option

    Hi...

    I have used the code from this link "https://community.dynamics.com/ax/b/axaptavsme/archive/2013/03/13/exporting-data-to-excel-from-axapta-x",  on the RunBaseBatch class, But i have got this error "Method 'item' in COM object of class 'Sheets' returned error code 0x8002000B (<unknown>) which means: <unknown>."

  • Community Member Profile Picture
    on at
    RE: Export specific data using Export to Excel option

    I have used the code from this link on the runBaseBatch class "https://dynamicsaxgyan.wordpress.com/2012/04/24/sysexcelworksheethelper-class-in-ax-2012quickly-create-excel-x/", and i have got this error "Method 'item' in COM object of class 'Sheets' returned error code 0x8002000B (<unknown>) which means: <unknown>.", The error thrown from this line of code "worksheet = sysExcelHelper.addWorksheet("Test");".

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Export specific data using Export to Excel option

    I have found a solution for this.

    Override the clicked() method on the Export to excel comand button. In the clicked() method before the super() call, write the below line of code:

    element.selectControl([YourGrid]);


    Thanks for all your suggestions.


    Thanks

  • André Arnaud de Calavon Profile Picture
    298,244 Super User 2025 Season 2 on at
    RE: Export specific data using Export to Excel option

    Hi JeffGreenRC,

    In addition to the answer from Vilmos:

    Functionally you can also try to use the shortcut CTRL+T.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Export specific data using Export to Excel option

    You could just create your own button to do this, since the Export to Excel is a canned framework. You could find some details on this on a Microsoft blog article:

    https://blogs.msdn.microsoft.com/emeadaxsupport/2009/09/07/how-does-the-export-to-excel-feature-work-under-the-hood/

    Here are some examples how you could create your custom code to do the export:

    community.dynamics.com/.../exporting-data-to-excel-from-axapta-x

    https://dynamicsaxgyan.wordpress.com/2012/04/24/sysexcelworksheethelper-class-in-ax-2012quickly-create-excel-x/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans