Use excel components and code the export:

Example from previous posting....

static void Job1(Args _args)
{

   SysExcelApplication     excelApp = SysExcelApplication::construct();
   SysExcelWorkSheet       excelWorksheet;
   SysExcelRange           excelRange;
   SysExcelCells           excelCells;
   SysExcelCell            excelCell;
   ComVariant              cellValue = new ComVariant() ;
   EmplTable               empTable;
   int                     i;
   // Open our template file
   excelApp.workbooks().open( 'c:\\tmp\\empl_rep.xlt' );
   // Obtain first worksheet
   excelWorksheet = excelApp.worksheets().itemFromNum( 1 );
   // Obtain cells on that worksheet
   excelCells = excelWorksheet.cells();
   // select data from emploee's table and output EmplId and Name into our template
   while select empTable
   {
       excelCells.item( 5 + i, 2 ).value( cellValue.bStr( empTable.EmplId ) );
       excelCells.item( 5 + i, 3 ).value( cellValue.bStr( empTable.Name ) );
       i++;
   }
   excelApp.visible( true );


}



 
On 12/8/05, hello world <[EMAIL PROTECTED]> wrote:
Hi All,
 
     I am facing a problem regarding exporting and importing of excel worksheets. i want to export the Inventsum table. but from the Admin-->Periodic-->data import/export-->excel spreadsheet --> templatewizard. this table does not appear in the table list.(Show All Tables).
 
      if i create a excel worksheet say named inventsum.xls. and enter the same fields that is in that axapta table. now when i tried to import that same file through Admin-->Periodic-->data import/export-->Definition Groups. i got the error that
 
     Excel worksheet inventsum.xls does not contain the table inventsum.
 
Another way i tried is to export the file through code, i export the table inventsum in csv mode. is there any way to export the table in xls mode.
because i am not able to export that csv file.
 
how is it possible.
 
Thanks in advance
Mukesh


Yahoo! India Matrimony: Find your partner now.

Sharing the knowledge on Axapta.



SPONSORED LINKS
Business finance course Business to business finance Small business finance
Business finance consultant Business finance magazine Business finance schools


YAHOO! GROUPS LINKS






--
Regards

** Niel **
---------------------------
D.J. Redelinghuys

"Give a man a computer program and you give him a headache,
but teach him to program computers and you give him the power to create
headaches for others for the rest of his life..."
        R. B. Forest

Public WebSite:
http://gundwale.tripod.com/

Sharing the knowledge on Axapta.



SPONSORED LINKS
Business finance course Business to business finance Small business finance
Business finance consultant Business finance magazine Business finance schools


YAHOO! GROUPS LINKS




Reply via email to