Axaptapedia is now maintained by AgileCadence For more information please click here.

Difference between revisions of "ExcelIo"

From Axaptapedia
Jump to: navigation, search
(Download)
(Download)
 
Line 5: Line 5:
  
 
==Download==
 
==Download==
[[Image:Class_ExcelIo.xpo]] XPO file for Axapta 3.0 and up
+
[[Image:Class_ExcelIo.xpo]] XPO file for Axapta 3.0 and up.
[[Image:Class_ExcelIo2.zip]] zipped XPO file for Axapta 2012 and up
+
 
 +
[[Image:Class_ExcelIo2.zip]] zipped XPO file for Axapta 2012 and up.
  
 
==How to use==
 
==How to use==

Latest revision as of 11:42, 8 January 2016

Purpose[edit]

To read an Excel file in way mimicking CommaIo.

The writeExp method is not implemented.

Download[edit]

File:Class ExcelIo.xpo XPO file for Axapta 3.0 and up.

File:Class ExcelIo2.zip zipped XPO file for Axapta 2012 and up.

How to use[edit]

Just use ExcelIo as a replacement for CommaIo.

static void ExcelIoTest(Args _args)
{
   ExcelIo io;
   #Excel
   dialogField dialogFilename;
   Dialog dialog = new Dialog("Excel Upload");
   container con;
   ;
   dialogFilename = dialog.addField(typeId(FilenameOpen));
   dialog.filenameLookupTitle("Upload from Excel");
   dialog.filenameLookupFilter(["@SYS28576",#XLSX, "@SYS28576",#XLS]);
   if (!dialog.run())
       return;
   io = new ExcelIo(dialogFilename.value(), 'r');
   setprefix("Excel Import");
   while (io.status() == IO_Status::Ok)
   {
       con = io.read();
       info(con2str(con));
   }
   io.close(); //To quit Excel
}