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

ExcelIo

From Axaptapedia
Revision as of 09:29, 28 July 2011 by JanKjeldsen (Talk | contribs)

Jump to: navigation, search

Purpose

To read an Excel file in way mimicking CommaIo.

The writeExp method is not implemented.

Download

File:Class ExcelIo.xpo

How to use

Just use ExcelIo as a replacement for CommaIo

<xpp> 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));
   }

} </xpp>