Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Grouping Excel sheet columns while exporting data through X++

Posted on by 420

Hope you are doing good,

I am working on one requirement form one of my client which is to export data from ax to Excel through X++ code. But there is one tricky condition to group excel columns while exporting data. Please let me know if you have any idea/solution related to this.

Regards

Anjaneya 

*This post is locked for comments

  • Mikael P. Profile Picture
    Mikael P. 10 on at
    RE: Grouping Excel sheet columns while exporting data through X++

    Hi,

    My Excel export works but I cannot find the good syntax to use method Range.group(...).

    For example, method merge works fine:

           rangeCOM = _sysExcelWorkSheet.cells().range("A1:A2").comObject();

           rangeCOM.merge();

           rangeCOM.horizontalAlignment(#xlRight);

    That's why I would like to see exact syntax to use group(...) method.

    Regards,

    Mikaël Pires

  • Mikael P. Profile Picture
    Mikael P. 10 on at
    RE: Grouping Excel sheet columns while exporting data through X++

    Hi,

    I try to use method  sysExcelRange.comObject().group(...) but i always receive this error "Group method of range class is failed".

    I have tried with several parameters calls, several ranges, etc...

    Can you show me how you call this method please?

    I am in AX2009 SP1 with office 365.

    Regards,

    Mikaël P.

  • Anjaney Profile Picture
    Anjaney 420 on at
    RE: Grouping Excel sheet columns while exporting data through X++

    Thanks Crispin .. your suggestion ""sysExcelRange.comObject().group(_Parameter to Switch rows/columns)"" worked

  • Anjaney Profile Picture
    Anjaney 420 on at
    RE: Grouping Excel sheet columns while exporting data through X++

    Hi Rustem/Crispin,

    Thanks for reply but its not merging of columns but the data grouping feature available on path (Excel sheet >> Data >> Group >>Rows/Columns)..

    Please let me know if i m still not clear.

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Grouping Excel sheet columns while exporting data through X++

    Hi!

    The "group excel columns while exporting data" - it's mean merge columns?

    Can you provide more information, please.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans