Exporting to excel

mike_espina
Member Posts: 55
Hi experts,
Is there a functionality in AXAPTA 3.0 that you can export directly the data from the tables in excel. And can you select some fields in the table and not all fields.
Tnx
Mike
Is there a functionality in AXAPTA 3.0 that you can export directly the data from the tables in excel. And can you select some fields in the table and not all fields.
Tnx
Mike
0
Comments
-
Hi Mike,
Currently, Axapta only exports to two kinds of files: Binary and CSV.
There are some options which you should consider:
1) if you just want to copy the data from an Axapta grid to Excel, you could select the records you want to copy and Copy and Paste to Excel cells.
2) You could import to CSV and load that file into Excel. If it is ok, then you have your solution.
However, it is not difficult to create code that exports data to Excel, considering that Axapta can access Excel through COM.
You could create a job like the following example (by Khue Trinh), replacing custTable with any table, and the fields Account num and Name with the desired fields.
static void Excel(Args _args)
{
SysExcelApplication ExcelApplication;
SysExcelWorkBooks ExcelWorkBooks;
SysExcelWorkBook ExcelWorkBook;
SysExcelWorkSheets ExcelWorkSheets;
SysExcelWorkSheet ExcelWorkSheet;
SysExcelRange ExcelRange;
CustTable custTable;
int row = 1;
;
ExcelApplication = SysExcelApplication::construct();
ExcelApplication.visible(true);
ExcelWorkBooks = ExcelApplication.workbooks();
ExcelWorkBook = ExcelWorkBooks.add();
ExcelWorkSheets = ExcelWorkBook.worksheets();
ExcelWorkSheet = ExcelWorkSheets.itemFromNum(1);
ExcelWorkSheet.cells().item(row,1).value('Account num');
ExcelWorkSheet.cells().item(row,2).value('Name');
row++;
while select custTable
{
ExcelWorkSheet.cells().item(row,1).value(custTable.AccountNum);
ExcelWorkSheet.cells().item(row,2).value(custTable.Name);
row++;
}
ExcelApplication.finalize();
}0 -
hi.. thanks for the reply.. It was very helpfull to me..0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions