Wrapper funcional de LibXL (Solucionado)

Wrapper funcional de LibXL (Solucionado)

Postby jose_murugosa » Fri Nov 25, 2022 1:43 pm

He visto notas en el foro recomendando esta lib.
Necesito poder generar archivos xlsx sin tener instalado MS Office.
Alguien tiene un wrapper funcional para esta lib que se pueda usar con harbour y fivewin y que desee compartir en el foro?

Gracias desde ya por vuestra atención.
Last edited by jose_murugosa on Wed Dec 14, 2022 1:08 pm, edited 1 time in total.
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Re: LibXL

Postby karinha » Fri Nov 25, 2022 4:57 pm

Mira se ayuda:

Code: Select all  Expand view

Carpeta de C:\LIBXL\examples\xbase\HBLibXL

05/12/2013  10:08                88 debug.cmd
03/02/2022  13:25             3.814 Example-AutoFilter_ByValues.PRG
03/02/2022  13:36             4.174 Example-AutoFilter_num_custom_filter.PRG
03/02/2022  13:36             3.779 Example-AutoFilter_string_custom_filter.PRG
31/01/2022  12:33             3.035 Example-AutoFilter_Top10.PRG
02/12/2013  12:12               301 fertig.CMD
03/02/2022  13:27            21.267 HBLibXL.CH
03/02/2022  13:27           147.559 HBLibXL.PRG
31/01/2022  13:09           303.405 Liesmich.pdf
03/05/2017  09:43            23.552 MyDefault.xls
31/01/2022  12:39             3.429 PROJECT.XPJ
31/01/2022  13:09           300.093 ReadMe.pdf
31/01/2022  11:04             3.070 Test-Macro.PRG
02/12/2013  06:55                77 test.cmd
22/01/2014  09:41             5.933 Test1.PRG
03/05/2017  09:51             8.122 Test2.PRG
22/06/2017  09:39             4.223 Test3.PRG
31/01/2022  12:00               168 _clean.cmd

 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: LibXL

Postby karinha » Fri Nov 25, 2022 4:59 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: LibXL

Postby karinha » Fri Nov 25, 2022 5:05 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: LibXL

Postby karinha » Fri Nov 25, 2022 5:07 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: LibXL

Postby karinha » Fri Nov 25, 2022 5:08 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: LibXL

Postby jose_murugosa » Mon Nov 28, 2022 5:39 pm

Gracias Karinha!!

Me pondré a leer e informarme. :D
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Wrapper funcional LibXL (Solucionado)

Postby jose_murugosa » Wed Dec 14, 2022 1:07 pm

Gracias a todos, anda perfecto!!!!!!
Por vuestra colaboración y ayuda dejo el wrapper para esta librería, está funcional hasta donde lo he probado con la última versión de libXl.

Code: Select all  Expand view

/*
 * LibxlFnc.prg - Wrapper for xHarbour - Libxl
 * -------------------------------------------
 *
 * LibXL is a library for direct reading and writing Excel files.
 * http://www.libxl.com
 * Based on libxl for windows 3.0.2 - 2010.09.15
 * Little changes introduced by José Murugosa to update it to ver. 4.04  last version
 *
 *
 * Copyright 2010 Edmond Broux <broux.edmond@wanadoo.fr>
 *                Edmond Broux 24700 Montpon Menesterol France
 *
 * Thanks to Jan Sperling
 * Thanks to Jean-Noel Dechereux - http://www.ntkproject.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
 *
 * As a special exception, the Harbour Project gives permission for
 * additional uses of the text contained in its release of Harbour.
 *
 * The exception is that, if you link the Harbour libraries with other
 * files to produce an executable, this does not by itself cause the
 * resulting executable to be covered by the GNU General Public License.
 * Your use of that executable is in no way restricted on account of
 * linking the Harbour library code into it.
 *
 * This exception does not however invalidate any other reasons why
 * the executable file might be covered by the GNU General Public License.
 *
 * This exception applies only to the code released by the Harbour
 * Project under the name Harbour.  If you copy code from other
 * Harbour Project or Free Software Foundation releases into a copy of
 * Harbour, as the General Public License permits, the exception does
 * not apply to the code that you add in this way.  To avoid misleading
 * anyone as to the status of such modified files, you must delete
 * this exception notice from them.
 *
 * If you write modifications of your own for Harbour, it is your choice
 * whether to permit this exception to apply to your modifications.
 * If you do not wish that, delete this exception notice.
*/

*------------------------------------------------------------------------------
* Low Level C Routines
*------------------------------------------------------------------------------

#pragma BEGINDUMP

   #include "C:\bcc7\include\windows\sdk\windows.h"!
   #include "shlobj.h"
   #include "hbapi.h"
   #include "hbvm.h"
   #include "hbstack.h"
   #include "hbapiitm.h"
   #include "..\include\libxl.h"
   // BookA.H

HB_FUNC( XLCREATEBOOKC )
{
   hb_retptr( (BookHandle) xlCreateBookCA() );
}

HB_FUNC( XLCREATEXMLBOOKC )
{
   hb_retptr( (BookHandle) xlCreateXMLBookCA() );
}

HB_FUNC( XLBOOKLOAD )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* filename = (const char*) hb_parc(2);

   hb_retl( (int) xlBookLoadA( handle , filename ) != 0 );
}

HB_FUNC( XLBOOKSAVE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* filename = (const char*) hb_parc(2);

   hb_retl( (int) xlBookSaveA( handle , filename ) != 0 );
}

HB_FUNC( XLBOOKLOADRAW )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* data  = (const char*) hb_parc(2);
   unsigned size = (unsigned) hb_parni(3);

   hb_retl( (int) xlBookLoadRawA( handle , data , size ) != 0 );
}

HB_FUNC( XLBOOKSAVERAW )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char** data  = (const char**) hb_parc(2);
   unsigned* size = (unsigned) hb_parni(3);

   hb_retl( (int) xlBookSaveRawA( handle , data , size ) != 0 );
}

HB_FUNC( XLBOOKADDSHEET )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* name = (const char*) hb_parc(2);
   SheetHandle initSheet = (SheetHandle) hb_parptr(3);

   hb_retptr( (SheetHandle) xlBookAddSheetA( handle , name , initSheet ) );
}

HB_FUNC( XLBOOKGETSHEET )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int index = (int) hb_parni(2);

   hb_retptr( (SheetHandle) xlBookGetSheetA( handle , index ) );
}

HB_FUNC( XLBOOKDELSHEET )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int index = (int) hb_parni(2);

   hb_retl( (int) xlBookDelSheetA( handle , index ) != 0 );
}

HB_FUNC( XLBOOKSHEETCOUNT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retni( (int) xlBookSheetCountA( handle ) );
}

HB_FUNC( XLBOOKADDFORMAT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   FormatHandle initFormat = (FormatHandle) hb_parptr(2);

   hb_retptr( (FormatHandle) xlBookAddFormatA( handle , initFormat ) );
}

HB_FUNC( XLBOOKADDFONT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   FontHandle initFont = (FontHandle) hb_parptr(2);

   hb_retptr( (FontHandle) xlBookAddFontA( handle , initFont ) );
}

HB_FUNC( XLBOOKADDCUSTOMNUMFORMAT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* customNumFormat = (const char*) hb_parc(2);

   hb_retni( (int) xlBookAddCustomNumFormatA( handle , customNumFormat ) );
}

HB_FUNC( XLBOOKCUSTOMNUMFORMAT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int fmt = (int) hb_parni(2);

   hb_retc( (const char*) xlBookCustomNumFormatA( handle , fmt ) );
}

HB_FUNC( XLBOOKFORMAT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int index = (int) hb_parni(2);

   hb_retptr( (FormatHandle) xlBookFormatA( handle , index ) );
}

HB_FUNC( XLBOOKFORMATSIZE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retni( (int) xlBookFormatSizeA( handle ) );
}

HB_FUNC( XLBOOKFONT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int index = (int) hb_parni(2);

   hb_retptr( (FontHandle) xlBookFontA( handle , index ) );
}

HB_FUNC( XLBOOKFONTSIZE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retni( (int) xlBookFontSizeA( handle ) );
}

HB_FUNC( XLBOOKDATEPACK )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int year = (int) hb_parni(2);
   int month = (int) hb_parni(3);
   int day = (int) hb_parni(4);
   int hour = (int) hb_parni(5);
   int min = (int) hb_parni(6);
   int sec = (int) hb_parni(7);
   int msec = (int) hb_parni(8);

   hb_retnd( (double) xlBookDatePackA( handle , year , month , day , hour , min , sec , msec ) );
}

HB_FUNC( XLBOOKDATEUNPACK )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   double value = (double) hb_parnd(2);
   int* year = (int*) hb_parni(3);
   int* month = (int*) hb_parni(4);
   int* day = (int*) hb_parni(5);
   int* hour = (int*) hb_parni(6);
   int* min = (int*) hb_parni(7);
   int* sec = (int*) hb_parni(8);
   int* msec = (int*) hb_parni(9);

   hb_retl( (int) xlBookDateUnpackA( handle , value , year , month , day , hour , min , sec , msec ) != 0 );
}

HB_FUNC( XLBOOKCOLORPACK )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int red = (int) hb_parni(2);
   int green = (int) hb_parni(3);
   int blue = (int) hb_parni(4);

   hb_retni( (int) xlBookColorPackA( handle , red , green , blue ) );
}

HB_FUNC( XLBOOKCOLORUNPACK )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int color = (int) hb_parni(2);
   int* red = (int*) hb_parni(3);
   int* green = (int*) hb_parni(4);
   int* blue = (int*) hb_parni(5);

   xlBookColorUnpackA( handle , color , red , green , blue );
   hb_retnl(1);
}

HB_FUNC( XLBOOKACTIVESHEET )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retni( (int) xlBookActiveSheetA( handle ) );
}

HB_FUNC( XLBOOKSETACTIVESHEET )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int index = (int) hb_parni(2);

   xlBookSetActiveSheetA( handle , index );
   hb_retnl(1);
}

HB_FUNC( XLBOOKADDPICTURE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* filename = (const char*) hb_parc(2);

   hb_retni( (int) xlBookAddPictureA( handle , filename ) );
}

HB_FUNC( XLBOOKADDPICTURE2 )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* data = (const char*) hb_parc(2);
   unsigned size = (unsigned) hb_parni(3);

   hb_retni( (int) xlBookAddPicture2A( handle , data , size ) );
}

HB_FUNC( XLBOOKDEFAULTFONT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int* fontSize = (int*) hb_parni(2);

   hb_retc( (const char*) xlBookDefaultFontA( handle , fontSize ) );
}

HB_FUNC( XLBOOKSETDEFAULTFONT )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* fontName = (const char*) hb_parc(2);
   int fontSize = (int) hb_parni(3);

   xlBookSetDefaultFontA( handle , fontName , fontSize );
   hb_retnl(1);
}

HB_FUNC( XLBOOKSETKEY )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const wchar_t* name = (const wchar_t*) hb_parc(2);
   const wchar_t* key  = (const wchar_t*) hb_parc(3);

   xlBookSetKeyA( handle , name , key );
   hb_retnl(1);
}

HB_FUNC( XLBOOKRGBMODE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retl( (int) xlBookRgbModeA( handle ) != 0 );
}

HB_FUNC( XLBOOKSETRGBMODE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   int rgbMode = (int) hb_parl(2);

   xlBookSetRgbModeA( handle , rgbMode );
   hb_retnl(1);
}

HB_FUNC( XLBOOKSETLOCALE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);
   const char* locale = (const char*) hb_parc(2);

   xlBookSetLocaleA( handle , locale );
   hb_retnl(1);
}

HB_FUNC( XLBOOKERRORMESSAGE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   hb_retc( (const char*) xlBookErrorMessageA( handle ) );
}

HB_FUNC( XLBOOKRELEASE )
{
   BookHandle handle = (BookHandle) hb_parptr(1);

   xlBookReleaseA( handle );
   hb_retnl(1);
}

   // --------
   // SheetA.H
   // --------

HB_FUNC( XLSHEETCELLTYPE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retni( (int) xlSheetCellTypeA( handle , row , col) );
}

HB_FUNC( XLSHEETISFORMULA )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retl( (int) xlSheetIsFormulaA( handle , row , col) != 0 );
}

HB_FUNC( XLSHEETCELLFORMAT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retptr( (FormatHandle) xlSheetCellFormatA( handle , row , col) );
}

HB_FUNC( XLSHEETSETCELLFORMAT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle format = (FormatHandle) hb_parptr(4);

   xlSheetSetCellFormatA( handle , row , col , format );
   hb_retnl(1);
}

HB_FUNC( XLSHEETREADSTR )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle* format = (FormatHandle*) hb_parptr(4);

   hb_retc( (const char*) xlSheetReadStrA( handle , row , col , format ) );
}

HB_FUNC( XLSHEETWRITESTR )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   const char* value = (const char*) hb_parc(4);
   FormatHandle format = (FormatHandle) hb_parptr(5);

   hb_retl( (int) xlSheetWriteStrA( handle , row , col , value , format ) != 0 );
}

HB_FUNC( XLSHEETREADNUM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle* format = (FormatHandle*) hb_parptr(4);

   hb_retnd( (double) xlSheetReadNumA( handle , row , col , format ) );
}

HB_FUNC( XLSHEETWRITENUM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   double value = (double) hb_parnd(4);
   FormatHandle format = (FormatHandle) hb_parptr(5);

   hb_retl( (int) xlSheetWriteNumA( handle , row , col , value , format ) != 0 );
}

HB_FUNC( XLSHEETREADBOOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle* format = (FormatHandle*) hb_parptr(4);

   hb_retl( (int) xlSheetReadBoolA( handle , row , col , format ) != 0 );
}

HB_FUNC( XLSHEETWRITEBOOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   int value  = (int) hb_parl(4);
   FormatHandle format = (FormatHandle) hb_parptr(5);

   hb_retl( (int) xlSheetWriteBoolA( handle , row , col , value , format ) != 0 );
}

HB_FUNC( XLSHEETREADBLANK )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle* format = (FormatHandle*) hb_parptr(4);

   hb_retl( (int) xlSheetReadBlankA( handle , row , col , format ) != 0 );
}

HB_FUNC( XLSHEETWRITEBLANK )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle format = (FormatHandle) hb_parptr(4);

   hb_retl( (int) xlSheetWriteBlankA( handle , row , col , format ) != 0 );
}

HB_FUNC( XLSHEETREADFORMULA )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   FormatHandle* format = (FormatHandle*) hb_parptr(4);

   hb_retc( (const char*) xlSheetReadFormulaA( handle , row , col , format ) );
}

HB_FUNC( XLSHEETWRITEFORMULA )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   const char* value = (const char*) hb_parc(4);
   FormatHandle format = (FormatHandle) hb_parptr(5);

   hb_retl( (int) xlSheetWriteFormulaA( handle , row , col , value , format ) != 0 );
}

HB_FUNC( XLSHEETREADCOMMENT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retc( (const char*) xlSheetReadCommentA( handle , row , col ) );
}

HB_FUNC( XLSHEETWRITECOMMENT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   const char* value = (const char*) hb_parc(4);
   const char* author = (const char*) hb_parc(5);
   int width = (int) hb_parni(6);
   int height = (int) hb_parni(7);

   xlSheetWriteCommentA( handle , row , col , value , author , width , height);
   hb_retnl(1);
}

HB_FUNC( XLSHEETISDATE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retl( (int) xlSheetIsDateA( handle , row , col ) != 0 );
}

HB_FUNC( XLSHEETREADERROR )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retni( (int) xlSheetReadErrorA( handle , row , col ) );
}

HB_FUNC( XLSHEETCOLWIDTH )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int col = (int) hb_parni(2);

   hb_retnd( (double) xlSheetColWidthA( handle , col ) );
}

HB_FUNC( XLSHEETROWHEIGHT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);

   hb_retnd( (double) xlSheetRowHeightA( handle , row ) );
}

HB_FUNC( XLSHEETSETCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int colFirst = (int) hb_parni(2);
   int colLast = (int) hb_parni(3);
   double width = (double) hb_parnd(4);
   FormatHandle format = (FormatHandle) hb_parptr(5);
   int hidden = (int) hb_parl(6);

   hb_retl( (int) xlSheetSetColA( handle , colFirst , colLast , width , format , hidden ) != 0 );
}

HB_FUNC( XLSHEETSETROW )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   double height = (double) hb_parnd(3);
   FormatHandle format = (FormatHandle) hb_parptr(4);
   int hidden = (int) hb_parl(5);

   hb_retl( (int) xlSheetSetRowA( handle , row , height , format , hidden ) != 0 );
}
HB_FUNC( XLSHEETGETMERGE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   int* rowFirst = (int*) hb_parni(4);
   int* rowLast  = (int*) hb_parni(5);
   int* colFirst = (int*) hb_parni(6);
   int* colLast  = (int*) hb_parni(7);

   hb_retl( (int) xlSheetGetMergeA( handle , row , col , rowFirst , rowLast , colFirst , colLast ) != 0 );
}

HB_FUNC( XLSHEETSETMERGE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowFirst = (int) hb_parni(2);
   int rowLast = (int) hb_parni(3);
   int colFirst = (int) hb_parni(4);
   int colLast = (int) hb_parni(5);

   hb_retl( (int) xlSheetSetMergeA( handle , rowFirst , rowLast , colFirst , colLast ) != 0 );
}

HB_FUNC( XLSHEETDELMERGE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   hb_retl( (int) xlSheetDelMergeA( handle , row , col ) != 0 );
}

HB_FUNC( XLSHEETSETPICTURE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);
   int pictureId = (int) hb_parni(4);
   double scale  = (double) hb_parnd(5);
   int offset_x  = (int)hb_parni(6);
   int offset_y  = (int)hb_parni(7);
   int pos       = (int)hb_parni(8);

   xlSheetSetPictureA( handle , row , col , pictureId , scale, offset_x, offset_y, pos );
   hb_retnl(1);
}

HB_FUNC( XLSHEETSETPICTURE2 )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row       = (int) hb_parni(2);
   int col       = (int) hb_parni(3);
   int pictureId = (int) hb_parni(4);
   int width     = (int) hb_parni(5);
   int height    = (int) hb_parni(6);
   int offset_x  = (int) hb_parni(7);
   int offset_y  = (int) hb_parni(8);
   int pos       = (int) hb_parni(9);

   xlSheetSetPicture2A( handle , row , col , pictureId , width , height, offset_x, offset_y, pos);
   hb_retnl(1);
}

HB_FUNC( XLSHEETSETHORPAGEBREAK )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int pageBreak = (int) hb_parl(3);

   hb_retl( (int) xlSheetSetHorPageBreakA( handle , row , pageBreak ) != 0 );
}

HB_FUNC( XLSHEETSETVERPAGEBREAK )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int col = (int) hb_parni(2);
   int pageBreak = (int) hb_parl(3);

   hb_retl( (int) xlSheetSetVerPageBreakA( handle , col , pageBreak ) != 0 );
}

HB_FUNC( XLSHEETSPLIT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int row = (int) hb_parni(2);
   int col = (int) hb_parni(3);

   xlSheetSplitA( handle , row , col );
   hb_retnl(1);
}

HB_FUNC( XLSHEETGROUPROWS )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowFirst = (int) hb_parni(2);
   int rowLast = (int) hb_parni(3);
   int collapsed = (int) hb_parl(4);

   hb_retl( (int) xlSheetGroupRowsA( handle , rowFirst , rowLast , collapsed ) != 0 );
}

HB_FUNC( XLSHEETGROUPCOLS )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int colFirst = (int) hb_parni(2);
   int colLast = (int) hb_parni(3);
   int collapsed = (int) hb_parl(4);

   hb_retl( (int) xlSheetGroupColsA( handle , colFirst , colLast , collapsed ) != 0 );
}

HB_FUNC( XLSHEETCLEAR )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowFirst = (int) hb_parni(2);
   int rowLast = (int) hb_parni(3);
   int colFirst = (int) hb_parni(4);
   int colLast = (int) hb_parni(5);

   xlSheetClearA( handle , rowFirst , rowLast , colFirst , colLast );
   hb_retnl(1);
}

HB_FUNC( XLSHEETINSERTCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int colFirst = (int) hb_parni(2);
   int colLast = (int) hb_parni(3);

   hb_retl( (int) xlSheetInsertColA( handle , colFirst , colLast ) != 0 );
}

HB_FUNC( XLSHEETINSERTROW )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowFirst = (int) hb_parni(2);
   int rowLast = (int) hb_parni(3);

   hb_retl( (int) xlSheetInsertRowA( handle , rowFirst , rowLast ) != 0 );
}

HB_FUNC( XLSHEETREMOVECOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int colFirst = (int) hb_parni(2);
   int colLast = (int) hb_parni(3);

   hb_retl( (int) xlSheetRemoveColA( handle , colFirst , colLast ) != 0 );
}

HB_FUNC( XLSHEETREMOVEROW )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowFirst = (int) hb_parni(2);
   int rowLast = (int) hb_parni(3);

   hb_retl( (int) xlSheetRemoveRowA( handle , rowFirst , rowLast ) != 0 );
}

HB_FUNC( XLSHEETCOPYCELL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int rowSrc = (int) hb_parni(2);
   int colSrc = (int) hb_parni(3);
   int rowDst = (int) hb_parni(4);
   int colDst = (int) hb_parni(5);

   hb_retl( (int) xlSheetCopyCellA( handle , rowSrc , colSrc , rowDst , colDst ) != 0 );
}

HB_FUNC( XLSHEETFIRSTROW )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetFirstRowA( handle ) );
}

HB_FUNC( XLSHEETLASTROW )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetLastRowA( handle ) );
}

HB_FUNC( XLSHEETFIRSTCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetFirstColA( handle ) );
}

HB_FUNC( XLSHEETLASTCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetLastColA( handle ) );
}

HB_FUNC( XLSHEETDISPLAYGRIDLINES )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetDisplayGridlinesA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETDISPLAYGRIDLINES )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int show = (int) hb_parl(2);

   xlSheetSetDisplayGridlinesA( handle , show );
   hb_retnl(1);
}

HB_FUNC( XLSHEETPRINTGRIDLINES )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetPrintGridlinesA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETPRINTGRIDLINES )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int print = (int) hb_parl(2);

   xlSheetSetPrintGridlinesA( handle , print );
   hb_retnl(1);
}

HB_FUNC( XLSHEETZOOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetZoomA( handle ) );
}

HB_FUNC( XLSHEETSETZOOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int zoom = (int) hb_parni(2);

   xlSheetSetZoomA( handle , zoom );
   hb_retnl(1);
}

HB_FUNC( XLSHEETPRINTZOOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetPrintZoomA( handle ) );
}

HB_FUNC( XLSHEETSETPRINTZOOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int zoom = (int) hb_parni(2);

   xlSheetSetPrintZoomA( handle , zoom );
   hb_retnl(1);
}

HB_FUNC( XLSHEETLANDSCAPE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetLandscapeA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETLANDSCAPE )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int landscape = (int) hb_parl(2);

   xlSheetSetLandscapeA( handle , landscape );
   hb_retnl(1);
}

HB_FUNC( XLSHEETPAPER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retni( (int) xlSheetPaperA( handle ) );
}

HB_FUNC( XLSHEETSETPAPER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int paper = (int) hb_parni(2);

   xlSheetSetPaperA( handle , paper );
   hb_retnl(1);
}

HB_FUNC( XLSHEETHEADER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retc( (const char*) xlSheetHeaderA( handle ) );
}

HB_FUNC( XLSHEETSETHEADER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   const char* header = (const char*) hb_parc(2);
   double margin = (double) hb_parnd(3);

   hb_retl( (int) xlSheetSetHeaderA( handle , header , margin ) != 0 );
}

HB_FUNC( XLSHEETHEADERMARGIN )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetHeaderMarginA( handle ) );
}

HB_FUNC( XLSHEETFOOTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retc( (const char*) xlSheetFooterA( handle ) );
}

HB_FUNC( XLSHEETSETFOOTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   const char* footer = (const char*) hb_parc(2);
   double margin = (double) hb_parnd(3);

   hb_retl( (int) xlSheetSetFooterA( handle , footer , margin ) != 0 );
}

HB_FUNC( XLSHEETFOOTERMARGIN )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetFooterMarginA( handle ) );
}

HB_FUNC( XLSHEETHCENTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetHCenterA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETHCENTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int hCenter = (int) hb_parl(2);

   xlSheetSetHCenterA( handle , hCenter );
   hb_retnl(1);
}

HB_FUNC( XLSHEETVCENTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetVCenterA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETVCENTER )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int vCenter = (int) hb_parl(2);

   xlSheetSetVCenterA( handle , vCenter );
   hb_retnl(1);
}

HB_FUNC( XLSHEETMARGINLEFT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetMarginLeftA( handle ) );
}

HB_FUNC( XLSHEETSETMARGINLEFT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   double margin = (double) hb_parnd(2);

   xlSheetSetMarginLeftA( handle , margin );
   hb_retnl(1);
}

HB_FUNC( XLSHEETMARGINRIGHT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetMarginRightA( handle ) );
}

HB_FUNC( XLSHEETSETMARGINRIGHT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   double margin = (double) hb_parnd(2);

   xlSheetSetMarginRightA( handle , margin );
   hb_retnl(1);
}

HB_FUNC( XLSHEETMARGINTOP )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetMarginTopA( handle ) );
}

HB_FUNC( XLSHEETSETMARGINTOP )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   double margin = (double) hb_parnd(2);

   xlSheetSetMarginTopA( handle , margin );
   hb_retnl(1);
}

HB_FUNC( XLSHEETMARGINBOTTOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retnd( (double) xlSheetMarginBottomA( handle ) );
}

HB_FUNC( XLSHEETSETMARGINBOTTOM )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   double margin = (double) hb_parnd(2);

   xlSheetSetMarginBottomA( handle , margin );
   hb_retnl(1);
}

HB_FUNC( XLSHEETPRINTROWCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetPrintRowColA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETPRINTROWCOL )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int print = (int) hb_parl(2);

   xlSheetSetPrintRowColA( handle , print );
   hb_retnl(1);
}

HB_FUNC( XLSHEETNAME )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retc( (const char*) xlSheetNameA( handle ) );
}

HB_FUNC( XLSHEETSETNAME )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   const char* name = (const char*) hb_parc(2);

   xlSheetSetNameA( handle , name );
   hb_retnl(1);
}

HB_FUNC( XLSHEETPROTECT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);

   hb_retl( (int) xlSheetProtectA( handle ) != 0 );
}

HB_FUNC( XLSHEETSETPROTECT )
{
   SheetHandle handle = (SheetHandle) hb_parptr(1);
   int protect = (int) hb_parl(2);

   xlSheetSetProtectA( handle , protect );
   hb_retnl(1);
}

   // ---------
   // FormatA.H
   // ---------

HB_FUNC( XLFORMATFONT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retptr( (FontHandle) xlFormatFontA( handle ) );
}

HB_FUNC( XLFORMATSETFONT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   FontHandle fontHandle = (FontHandle) hb_parptr(2);

   hb_retl( (int) xlFormatSetFontA( handle , fontHandle ) != 0 );
}

HB_FUNC( XLFORMATNUMFORMAT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatNumFormatA( handle ) );
}

HB_FUNC( XLFORMATSETNUMFORMAT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int numFormat = (int) hb_parni(2);

   xlFormatSetNumFormatA( handle , numFormat );
   hb_retnl(1);
}

HB_FUNC( XLFORMATALIGNH )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatAlignHA( handle ) );
}

HB_FUNC( XLFORMATSETALIGNH )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int align = (int) hb_parni(2);

   xlFormatSetAlignHA( handle , align );
   hb_retnl(1);
}

HB_FUNC( XLFORMATALIGNV )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatAlignVA( handle ) );
}

HB_FUNC( XLFORMATSETALIGNV )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int align = (int) hb_parni(2);

   xlFormatSetAlignVA( handle , align );
   hb_retnl(1);
}

HB_FUNC( XLFORMATWRAP )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retl( (int) xlFormatWrapA( handle ) != 0 );
}

HB_FUNC( XLFORMATSETWRAP )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int wrap = (int) hb_parl(2);

   xlFormatSetWrapA( handle , wrap );
   hb_retnl(1);
}

HB_FUNC( XLFORMATROTATION )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatRotationA( handle ) );
}

HB_FUNC( XLFORMATSETROTATION )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int rotation = (int) hb_parni(2);

   hb_retl( (int) xlFormatSetRotationA( handle , rotation ) != 0 );
}

HB_FUNC( XLFORMATINDENT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatIndentA( handle ) );
}

HB_FUNC( XLFORMATSETINDENT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int indent = (int) hb_parni(2);

   xlFormatSetIndentA( handle , indent );
   hb_retnl(1);
}

HB_FUNC( XLFORMATSHRINKTOFIT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retl( (int) xlFormatShrinkToFitA( handle ) != 0 );
}

HB_FUNC( XLFORMATSETSHRINKTOFIT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int shrinkToFit = (int) hb_parl(2);

   xlFormatSetShrinkToFitA( handle , shrinkToFit );
   hb_retnl(1);
}

HB_FUNC( XLFORMATSETBORDER )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATSETBORDERCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERLEFT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderLeftA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERLEFT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderLeftA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERRIGHT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderRightA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERRIGHT )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderRightA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERTOP )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderTopA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERTOP )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderTopA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERBOTTOM )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderBottomA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERBOTTOM )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderBottomA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERLEFTCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderLeftColorA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERLEFTCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderLeftColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERRIGHTCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderRightColorA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERRIGHTCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderRightColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERTOPCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderTopColorA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERTOPCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderTopColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERBOTTOMCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderBottomColorA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERBOTTOMCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderBottomColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERDIAGONAL )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderDiagonalA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERDIAGONAL )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int border = (int) hb_parni(2);

   xlFormatSetBorderDiagonalA( handle , border );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERDIAGONALSTYLE )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderDiagonalStyleA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERDIAGONALSTYLE )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int style = (int) hb_parni(2);

   xlFormatSetBorderDiagonalStyleA( handle , style );
   hb_retnl(1);
}

HB_FUNC( XLFORMATBORDERDIAGONALCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatBorderDiagonalColorA( handle ) );
}

HB_FUNC( XLFORMATSETBORDERDIAGONALCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetBorderDiagonalColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATFILLPATTERN )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatFillPatternA( handle ) );
}

HB_FUNC( XLFORMATSETFILLPATTERN )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int pattern = (int) hb_parni(2);

   xlFormatSetFillPatternA( handle , pattern );
   hb_retnl(1);
}

HB_FUNC( XLFORMATPATTERNFOREGROUNDCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatPatternForegroundColorA( handle ) );
}

HB_FUNC( XLFORMATSETPATTERNFOREGROUNDCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetPatternForegroundColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATPATTERNBACKGROUNDCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retni( (int) xlFormatPatternBackgroundColorA( handle ) );
}

HB_FUNC( XLFORMATSETPATTERNBACKGROUNDCOLOR )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFormatSetPatternBackgroundColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFORMATLOCKED )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retl( (int) xlFormatLockedA( handle ) != 0 );
}

HB_FUNC( XLFORMATSETLOCKED )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int locked = (int) hb_parl(2);

   xlFormatSetLockedA( handle , locked );
   hb_retnl(1);
}

HB_FUNC( XLFORMATHIDDEN )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);

   hb_retl( (int) xlFormatHiddenA( handle ) != 0 );
}

HB_FUNC( XLFORMATSETHIDDEN )
{
   FormatHandle handle = (FormatHandle) hb_parptr(1);
   int hidden = (int) hb_parl(2);

   xlFormatSetHiddenA( handle , hidden );
   hb_retnl(1);
}

   // --------
   //  FontA.H
   // --------

HB_FUNC( XLFONTSIZE )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontSizeA( handle ) );
}

HB_FUNC( XLFONTSETSIZE )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int size = (int) hb_parni(2);

   xlFontSetSizeA( handle , size );
   hb_retnl(1);
}

HB_FUNC( XLFONTITALIC )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontItalicA( handle ) );
}

HB_FUNC( XLFONTSETITALIC )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int italic = (int) hb_parl(2);

   xlFontSetItalicA( handle , italic );
   hb_retnl(1);
}

HB_FUNC( XLFONTSTRIKEOUT )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontStrikeOutA( handle ) );
}

HB_FUNC( XLFONTSETSTRIKEOUT )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int strikeOut = (int) hb_parl(2);

   xlFontSetStrikeOutA( handle , strikeOut );
   hb_retnl(1);
}

HB_FUNC( XLFONTCOLOR )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontColorA( handle ) );
}

HB_FUNC( XLFONTSETCOLOR )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int color = (int) hb_parni(2);

   xlFontSetColorA( handle , color );
   hb_retnl(1);
}

HB_FUNC( XLFONTBOLD )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontBoldA( handle ) );
}

HB_FUNC( XLFONTSETBOLD )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int bold = (int) hb_parl(2);

   xlFontSetBoldA( handle , bold );
   hb_retnl(1);
}

HB_FUNC( XLFONTSCRIPT )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontScriptA( handle ) );
}

HB_FUNC( XLFONTSETSCRIPT )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int script = (int) hb_parni(2);

   xlFontSetScriptA( handle , script );
   hb_retnl(1);
}

HB_FUNC( XLFONTUNDERLINE )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retni( (int) xlFontUnderlineA( handle ) );
}

HB_FUNC( XLFONTSETUNDERLINE )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   int underline = (int) hb_parni(2);

   xlFontSetUnderlineA( handle , underline );
   hb_retnl(1);
}

HB_FUNC( XLFONTNAME )
{
   FontHandle handle = (FontHandle) hb_parptr(1);

   hb_retc( (const char*) xlFontNameA( handle ) );
}

HB_FUNC( XLFONTSETNAME )
{
   FontHandle handle = (FontHandle) hb_parptr(1);
   const char* name = (const char*) hb_parc(2);

   xlFontSetNameA( handle , name );
   hb_retnl(1);
}

#pragma ENDDUMP
 


Nuevamente gracias a atodos.
Last edited by jose_murugosa on Wed Dec 14, 2022 1:11 pm, edited 1 time in total.
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Re: Wrapper funcional de LibXL (Solucionado)

Postby hmpaquito » Wed Dec 14, 2022 1:09 pm

Hola Jose,

Vendria muy bien un ejemplo de creacion y consulta de una excel.
Lo digo porque igual si vemos como se hace algunos nos animamos a comprarla.

Salu2
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Wrapper funcional de LibXL (Solucionado)

Postby jose_murugosa » Wed Dec 14, 2022 1:12 pm

hmpaquito wrote:Hola Jose,

Vendria muy bien un ejemplo de creacion y consulta de una excel.
Lo digo porque igual si vemos como se hace algunos nos animamos a comprarla.

Salu2


Dale, preparo uno y lo subo
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Re: Wrapper funcional de LibXL (Solucionado)

Postby jose_murugosa » Wed Dec 14, 2022 7:01 pm

Un ejemplo sencillo que genera una hoja xlsx

Code: Select all  Expand view

//------------------------------------------------------------------------------------
#include "fivewin.ch"
#include "ord.ch"
//------------------------------------------------------------------------------------
FUNCTION Main()
LOCAL book, sheet, sheet2, linea
LOCAL xf
LOCAL num_format1, date_format
LOCAL Header_Font, header_Format
LOCAL Line_Font, Line_Format

     set date italian
     set century on

     book =   xlCreateXMLBookC()
     Header_Font = xlBookAddFont( book, 0 )
     xlFontSetName( Header_Font , "Arial" )
     xlFontSetSize( Header_Font , 12 )
     xlFontBold( Header_Font )

     Line_Font = xlBookAddFont( book, 0 )
     xlFontSetName( Line_Font , "Arial" )
     xlFontSetSize( Line_Font , 9 )

     header_Format = xlBookAddFormat( book, 0 )
     xlFormatSetFont( header_Format, Header_Font )

     Line_Format = xlBookAddFormat( book, 0 )
     xlFormatSetFont( Line_Format, Line_Font )

     num_format1 = xlBookAddFormat( book, 0 )
     xf = xlBookAddCustomNumFormat( book , "###,###,###,##0" )
     xlFormatSetNumFormat( num_format1, xf )
     xlFormatSetFont( num_format1, Line_Font )

     date_format = xlBookAddFormat( book, 0 )
     xf = xlBookAddCustomNumFormat( book , "DD/MM/YYYY" )
     xlFormatSetNumFormat( date_format, xf )
     xlFormatSetFont( date_format, Line_Font )

     sheet = xlBookAddSheet(book, "Hoja1", 0)
     sheet2= xlBookAddSheet(book, "Hoja2", 0)



     use "EMPLOYEE" NEW ALIAS nomi
     dbgotop()
     linea = 1   //si se usa opcion de pago poner 0 utilizando la primera línea
                //si se usa opción de prueba poner 1 porque en la primera línea se
                //   un cartel que no deja ver los títulos

     xlSheetWriteStr(sheet, linea, 0, "Nombre", header_Format)
     xlSheetWriteStr(sheet, linea, 1, "Apellido", header_Format)
     xlSheetWriteStr(sheet, linea, 2, "Dirección", header_Format)
     xlSheetWriteStr(sheet, linea, 3, "Ciudad ", header_Format)
     xlSheetWriteStr(sheet, linea, 4, "Estado", header_Format)
     xlSheetWriteStr(sheet, linea, 5, "Cod.Postal", header_Format)
     xlSheetWriteStr(sheet, linea, 6, "Fecha de nacimiento", header_Format)
     xlSheetWriteStr(sheet, linea, 7, "Casamiento", header_Format)
     xlSheetWriteStr(sheet, linea, 8, "Edad ", header_Format)
     xlSheetWriteStr(sheet, linea, 9, "Salario", header_Format)

     do while !eof()
          linea ++
          xlSheetWriteStr(sheet, linea, 0, nomi->FIRST, Line_Format)
          xlSheetWriteStr(sheet, linea, 1, nomi->LAST, Line_Format)
          xlSheetWriteStr(sheet, linea, 2, nomi->STREET, Line_Format)
          xlSheetWriteStr(sheet, linea, 3, nomi->CITY, Line_Format)
          xlSheetWriteStr(sheet, linea, 4, nomi->STATE, Line_Format)
          xlSheetWriteStr(sheet, linea, 5, nomi->ZIP, Line_Format)
          xlSheetWriteStr(sheet, linea, 6, dtoc(nomi->HIREDATE), date_format)
          xlSheetWriteBool(sheet, linea, 7, nomi->MARRIED, Line_Format)
          xlSheetWriteNum(sheet, linea, 8, nomi->AGE, num_format1)
          xlSheetWriteNum(sheet, linea, 9, nomi->SALARY, num_format1)
          dbskip()
     enddo

     nomi->(dbclosearea())
     linea++

     //las líneas y las columnas para LibXL arrancan de 0 y en las fórmulas de excel por 1
     //para ubicar la fórmula en la fila 6 deberá indicarse la línea 5 pero en la fórmula se
     //indicará la línea con la numeración de la planilla, por lo cual la línea 5 en una fórmula
     //será la que aparece como línea 5 en la excel (la quinta línea y no la _) OJO!!!!!

     xlSheetWriteFormula(sheet, linea , 8, "=SUM(I3:I" + alltrim(str(linea))+")", num_format1)
     xlSheetWriteFormula(sheet, linea , 9, "=SUM(J3:J" + alltrim(str(linea))+")", num_format1)

     xlSheetWriteStr(sheet2, 1, 0, "Texto de Prueba", header_Format)

     xlBookSave( book, ".\ejemplo.xlsx" )       //graba el libro
     xlBookRelease( book )                   //libera el libro (cierra)

     msgwait( "Fin", "Informacion", 2 )

RETURN nil
 


Utiliza la tabla employee con el indice ntx para generar la excel.
Aquí Tabla e Índice
https://mega.nz/file/LVxCiYra#Ehbb66gg3 ... UhwVLF-s3o
Last edited by jose_murugosa on Fri Dec 16, 2022 3:48 pm, edited 2 times in total.
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Re: Wrapper funcional de LibXL (Solucionado)

Postby hmpaquito » Thu Dec 15, 2022 8:23 am

Gracias Jose.

PD. Vendría bien hacer una sencilla clase para manejo de las funciones
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Wrapper funcional de LibXL (Solucionado)

Postby jose_murugosa » Fri Dec 16, 2022 3:43 pm

hmpaquito wrote:Gracias Jose.
PD. Vendría bien hacer una sencilla clase para manejo de las funciones


Yo encuentro las funciones muy sencillas y potentes, es muy fácil generar excels con ella xlsx o xls, me siento a gusto con ellas y no siento la necesidad de crear una clase.
Actualicé el ejemplo con algunas explicaciones y 2 hojas en el libro.
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 33 guests