Quiet often we get the request from the clients that they wish if the reports or query data they design can be seen in excel in the Excel formatted way. Though the standard reports output can be sent to Excel but that is not formatted . Almost all the enquiries have a button to export the grid data to Excel but that gives them limitation of only the GRID data.
We have recently given the following two solutions in different scenarios to different clients. Where the data is not very huge ( the user is expecting a couple of hundred lines as a query output then the following solution will work nice.
Dynamics AX’s classes prefixed with SysExcel actually do the export to excel. We would use these classes and create a small list of customers alongwith the itemIds they have bought or placed order for.
Open the AOT. Create a shared project e.g. SD_ExcelExport
Create the a new class as shown below :
=================================================================================
=================================================================================