Introduction
I wrote already in the past about the possibilities to export data from your Dynamics AX ERP system to Microsoft Excel through X++ code.
My first post Export to Excel with X++ code described how to export some data to different worksheets in an Excel file.
My second post Export to Excel with X++ code: the sequel described how to format the exported data in the Excel export file.
In this post I further elaborate about the formatting of data.
Use of the comObject method of the SysExcelStyle class
I already explained the use of the SysExcelStyle class in my previous posts. I created a Header style and set its font to bold and a specific color. These methods are easy to use, as they can found with the IntelliSense functionality.
However, by using the comObject method, you can go even further and have extra formatting possibilities at your disposal. Unfortunately, these can’t be found with IntelliSense, nor I find documentation about it. I found already these possibilities, if someone finds other ones, please post a comment: it could be handy for others aswell…
...
SysExcelStyle style;
;
...
// Set orientation
style.comObject().orientation(90);
// distribute text
style.horizontalalignment(-4117);
// center text
style.horizontalalignment(-4108);
// right align text
style.horizontalalignment(-4152);
// set indent level
style.comObject().indentlevel(5);
// wrap text
style.comObject().wraptext(true);
...
Thank you Patrik Luca i has helped me lot.
now i am want to export the data from excel sheet in designed format means like i want to display data like UML class format so can you please help me
Thank You,
This was helpful too https://axapta2009.wordpress.com/2014/05/30/applying-formats-to-excel-reports-using-x-in-ax-2009/
Post a Comment