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

Notifications

Announcements

No record found.

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)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    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/

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi JeffGreenRC,

    In addition to the answer from Vilmos:

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

  • Verified answer
    Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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");".

  • Community Member Profile Picture
    on at

    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>."

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans