Read/write XLS without OLE

3,594 views
Skip to first unread message

Randy

unread,
Mar 26, 2012, 2:44:56 PM3/26/12
to Harbour Users
Hi all,

Does anyone have any experience reading/writing Excel XLS/XLSX files
from Harbour in a server environment _without_ using OLE? (As of
Office 2007, OLE is no longer supported in a server environment when
there is no user logged on).

Thanks!

Randy.

Klas Engwall

unread,
Mar 26, 2012, 9:11:09 PM3/26/12
to harbou...@googlegroups.com
Hi Randy,

Some people use the old ClipWks library for Clipper

http://joebooth-consulting.com/Dev/ClipWks

But it only creates worksheets (Excel 4.0 and below), not workbooks in
CFB "packaging" (the OLE container). This means that Excel will accept
the files but not external applications that only understand CFB files.

There are several projects "out there" that attempt to fill the gap, but
you will find none that can be used with Harbour without writing a lot
of wrappers. I have tried to dissect the CFB file format, and I found
that it should be doable, but a *LOT* of work is required. So at the
moment, as far as I know, there is no solution that can be just plugged
in. It would be an interesting project, though.

Regards,
Klas

Randy

unread,
Mar 27, 2012, 9:02:30 AM3/27/12
to Harbour Users
Hi Klas,

Thank you for your reply.

Unfortunately, I don't think ClipWks will work since I need 32/64 bit
support as well as support for XLSX files. Since OLE seems to work in
a desktop environment, this is only an issue on the server -
Therefore, I think we will have to deal with this using the Component
API Reference for Office.

Regards,
Randy.

Klas Engwall

unread,
Mar 27, 2012, 2:14:29 PM3/27/12
to harbou...@googlegroups.com
Hi Randy

> Thank you for your reply.
>
> Unfortunately, I don't think ClipWks will work since I need 32/64 bit
> support

Well, the Clipper lib file will not work, but source is included (.PRG
and .C) so it is possible to recompile with Harbour

> as well as support for XLSX files.

That is of course something that ClipWks has no knowledge of

> Since OLE seems to work in
> a desktop environment, this is only an issue on the server -
> Therefore, I think we will have to deal with this using the Component
> API Reference for Office.

OK. If you have success with that, please come back and tell us what you
did. I am sure many people would be interested.

Regards,
Klas

Alain Aupeix

unread,
Mar 28, 2012, 1:09:16 PM3/28/12
to harbou...@googlegroups.com
Le 27/03/2012 20:14, Klas Engwall a �crit :

> Hi Randy
>
>> Thank you for your reply.
>>
>> Unfortunately, I don't think ClipWks will work since I need 32/64 bit
>> support
>
> Well, the Clipper lib file will not work, but source is included (.PRG
> and .C) so it is possible to recompile with Harbour
>
>> as well as support for XLSX files.
docx and xlsx are xml based and docx or xlxs can easily be opened with a
zipper, or a zip function of Harbour. (in fact these are zip files as
openoffice documents.)

Have a look in it, and you will find what you will have to do to treat it.

A+

Bernard Mouille

unread,
Mar 28, 2012, 3:32:16 PM3/28/12
to Harbour Users

Hello,

I have work with the CLIPWKS to create a file.XLS and it work to write
datas in old EXCEL format (only datas, no design ) .

My problem is the TREAL.ASM in "Assembleur" :
- l_dtot() : Converts an IEEE 8 byte into an IEEE 10 byte real.
- l_ttod() : Converts an IEEE 10 byte into an IEEE 8 byte real.

Is somebody had this functions in Harbour or C ?

Thank you.

Bernard

Klas Engwall

unread,
Mar 28, 2012, 7:58:36 PM3/28/12
to harbou...@googlegroups.com
Hi Alain,

> docx and xlsx are xml based and docx or xlxs can easily be opened with a
> zipper, or a zip function of Harbour. (in fact these are zip files as
> openoffice documents.)
>
> Have a look in it, and you will find what you will have to do to treat it.

Sure. Both XLS and XLSX can be done. I did my own XLS routines in
Clipper (but not CFB). I have not yet tried to do any XML-based files,
just looked at the various parts inside the ZIP file. From there on it
is just a question of the small matter of doing it :-)

Regards,
Klas

Randy

unread,
Mar 29, 2012, 12:47:33 PM3/29/12
to Harbour Users
Hi all,

I found a library that you can use from C (and other languages) that
reads/writes both XLS and XLSX files without using OLE automation.
It's called LibXL and is available for both 32 and 64 bit.

http://www.libxl.com

Randy.

Jan Sperling

unread,
Mar 29, 2012, 12:53:14 PM3/29/12
to harbou...@googlegroups.com
Hi Randy / all:

I work with this library for about 2 years now, and it's a beauty...
You need to write a wrapper for the dll, but this is easily done.
If anyone is interested, I could send some HB func examples.

BR, Jan Sperling

-----Mensaje original-----
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com]
En nombre de Randy
Enviado el: Jueves, 29 de Marzo de 2012 10:48
Para: Harbour Users
Asunto: [harbour-users] Re: Read/write XLS without OLE

Hi all,

http://www.libxl.com

Randy.

--
You received this message because you are subscribed to the Google Groups
"Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

Randy

unread,
Mar 30, 2012, 9:52:48 AM3/30/12
to Harbour Users
Hi Jan,

Sure, some examples would be great - Thanks!

BR,
Randy
> Web:http://groups.google.com/group/harbour-users- Hide quoted text -
>
> - Show quoted text -

Jan Sperling

unread,
Mar 30, 2012, 10:00:16 AM3/30/12
to harbou...@googlegroups.com
Hi Randy / all:

This is the source I use to create XLS files.
The has many more functions, but this all I need so far...

*---------------------------------------------------------------------------
---
* Low Level C Routines
*---------------------------------------------------------------------------
---
#pragma BEGINDUMP

#include <windows.h>
#include <shlobj.h>

#include "hbapi.h"
#include "hbvm.h"
#include "hbstack.h"
#include "hbapiitm.h"
#include "libxl.h"


HB_FUNC(XLCREATEBOOK)
{
BookHandle book;
book = xlCreateBook();
hb_retptr( ( void * ) ( book ) );
}


HB_FUNC(XLBOOKSAVE)
{
BookHandle book = (BookHandle) hb_parptr(1);
LPCSTR fName = hb_parc(2);
bool res;

res = xlBookSave(book,fName);
hb_retnl((BOOL) res);
}

HB_FUNC(XLBOOKADDCUSTOMNUMFORMAT)
{
BookHandle book = (BookHandle) hb_parptr(1);
LPCSTR format = hb_parc(2);
int res;

res = xlBookAddCustomNumFormat(book,(const char *) format);
hb_retni((int) res);
}

HB_FUNC(XLBOOKADDFORMAT)
{
BookHandle book = (BookHandle) hb_parptr(1);
FormatHandle format = (FormatHandle) hb_parptr(2);
FormatHandle res;

res = xlBookAddFormat(book, format);
hb_retptr((FormatHandle) res);
}

HB_FUNC(XLFORMATSETNUMFORMAT)
{
FormatHandle hformat = (FormatHandle) hb_parptr(1);
int format = (int) hb_parni(2);

xlFormatSetNumFormat(hformat, format);
hb_retnl(1);
}

HB_FUNC(XLBOOKADDSHEET)
{
BookHandle book = (BookHandle) hb_parptr(1);
LPCSTR fName = hb_parc(2);
SheetHandle nSheet = (SheetHandle) hb_parni(3);
SheetHandle res;

res = xlBookAddSheet(book,fName,nSheet);
hb_retptr((SheetHandle) res);
}


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

xlBookRelease(book);
hb_retnl(1);
}

HB_FUNC(XLSHEETSETCOL)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int n1 = (int) hb_parni(2);
int n2 = (int) hb_parni(3);
int n3 = (int) hb_parni(4);
FormatHandle n4 = (FormatHandle) hb_parptr(5);
int n5 = (int) hb_parni(6);

xlSheetSetCol(nSheet,n1,n2,n3,n4,n5);
hb_retnl(1);
}

HB_FUNC(XLSHEETWRITENUM)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int x = (int) hb_parni(2);
int y = (int) hb_parni(3);
// float n = (float) hb_parnd(4);
double n = (double) hb_parnd(4);
FormatHandle n5 = (FormatHandle) hb_parptr(5);

xlSheetWriteNum(nSheet,x,y,n,n5);
hb_retnl(1);
}

HB_FUNC(XLSHEETWRITESTR)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int x = (int) hb_parni(2);
int y = (int) hb_parni(3);
LPCSTR n = (LPCSTR) hb_parc(4);
FormatHandle n5 = (FormatHandle) hb_parptr(5);

xlSheetWriteStr(nSheet,x,y,n,n5);
hb_retnl(1);
}


HB_FUNC(XLSHEETWRITEBLANK)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int x = (int) hb_parni(2);
int y = (int) hb_parni(3);
FormatHandle n4 = (FormatHandle) hb_parptr(4);

xlSheetWriteBlank(nSheet,x,y,n4);
hb_retnl(1);
}

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

res = xlBookDatePack(book,year,month,day,hour,min,sec,msec);
hb_retnd(res);
}

HB_FUNC(XLBOOKADDFONT)
{
BookHandle book = (BookHandle) hb_parptr(1);
FontHandle format = (FontHandle) hb_parptr(2);
FontHandle res;

res = xlBookAddFont(book, format);
hb_retptr((FontHandle) res);
}

HB_FUNC(XLFONTSETNAME)
{
FontHandle font = (FontHandle) hb_parptr(1);
LPCSTR format = hb_parc(2);

xlFontSetName(font,(const char *) format);
hb_retni(1);
}


HB_FUNC(XLFONTSETSIZE)
{
FontHandle font = (FontHandle) hb_parptr(1);
int nSize = hb_parni(2);

xlFontSetSize(font,nSize);
hb_retni(1);
}

HB_FUNC(XLFONTSETBOLD)
{
FontHandle font = (FontHandle) hb_parptr(1);
int nBold = hb_parni(2);

xlFontSetBold(font,nBold);
hb_retni(1);
}


HB_FUNC(XLFORMATSETFONT)
{
FormatHandle format = (FormatHandle) hb_parptr(1);
FontHandle font = (FontHandle) hb_parptr(2);

xlFormatSetFont(format,font);
hb_retni(1);
}

HB_FUNC(XLFORMATSETBORDER)
{
FormatHandle format = (FormatHandle) hb_parptr(1);
int nBorder = hb_parni(2);

xlFormatSetBorder(format,nBorder);
hb_retni(1);
}


HB_FUNC(XLFORMATSETBORDERBOTTOM)
{
FormatHandle format = (FormatHandle) hb_parptr(1);
int nBorder = hb_parni(2);

xlFormatSetBorderBottom(format,nBorder);
hb_retni(1);
}


HB_FUNC(XLFORMATSETFILLPATTERN)
{
FormatHandle format = (FormatHandle) hb_parptr(1);
int nPattern = hb_parni(2);

xlFormatSetFillPattern(format,nPattern);
hb_retni(1);
}

HB_FUNC(XLFORMATSETPATTERNFOREGROUNDCOLOR)
{
FormatHandle format = (FormatHandle) hb_parptr(1);
int nColor = hb_parni(2);

xlFormatSetPatternForegroundColor(format,(int) nColor);
hb_retni(1);
}

HB_FUNC(XLBOOKADDPICTURE)
{
BookHandle book = (BookHandle) hb_parptr(1);
LPCSTR fName = hb_parc(2);
int res;

res = xlBookAddPicture(book,fName);
hb_retni(res);
}

HB_FUNC(XLSHEETSETNAME)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
LPCSTR fName = hb_parc(2);

xlSheetSetName(nSheet,fName);
hb_retni(1);
}


HB_FUNC(XLSHEETSETPICTURE)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int x = (int) hb_parni(2);
int y = (int) hb_parni(3);
int pId = (int) hb_parni(4);
//double scale = (double) hb_parnl(5);
float scale = (float) hb_parnl(5);

xlSheetSetPicture(nSheet,x,y,pId,scale);
hb_retnl(1);
}

HB_FUNC(XLSHEETSETPICTURE2)
{
SheetHandle nSheet = (SheetHandle) hb_parptr(1);
int x = (int) hb_parni(2);
int y = (int) hb_parni(3);
int pId = (int) hb_parni(4);
int width = (int) hb_parnl(5);
int height = (int) hb_parnl(6);

xlSheetSetPicture2(nSheet,x,y,pId,width,height);
hb_retnl(1);
}


/*
HB_FUNC(XLBOOKSETKEY)
{
BookHandle book = (BookHandle) hb_parptr(1);
const char* kName = (const char*) hb_parc(2);
const char* kKey = (const char*) hb_parc(3);

xlBookSetKey(book,(const char*) kName,(const char*) kKey);
hb_retni(1);
}
*/

HB_FUNC(XLBOOKSETKEY)
{
BookHandle book = (BookHandle) hb_parptr(1);
const char* kName;
const char* kKey;

kName = "Your registered Name";
kKey = "Your Key";
xlBookSetKey((BookHandle) book,(LPCSTR) "Your registered Name",(LPCSTR)
"Your Key");
hb_retni(1);
}

#pragma ENDDUMP


Having this source, you could write something like this (don't remember if
this still works as is, was some early test):

book = xlCreateBook()
xlBookSetKey(book,"XXXXX","XXXXXXX")

f := {NIL,NIL,NIL,NIL,NIL,NIL}
format := {NIL,NIL,NIL,NIL,NIL,NIL}
f[1] = xlBookAddCustomNumFormat(book, "0.0")
f[2] = xlBookAddCustomNumFormat(book, "0.00")
f[3] = xlBookAddCustomNumFormat(book, "0.000")
f[4] = xlBookAddCustomNumFormat(book,
"#,###.000000000000000000000000000000000000")
f[5] = xlBookAddCustomNumFormat(book, "#,###.00 $")
f[6] = xlBookAddCustomNumFormat(book, "#,###.00 $[Black][<1000];#,###.00
$[Red][>=1000]")
for i = 1 to 6
format[i] = xlBookAddFormat(book, 0)
xlFormatSetNumFormat(format[i], f[i])
Next
sheet = xlBookAddSheet(book, "Custom formats", 0)
xlSheetSetCol(sheet, 0, 0, 20, 0, 0)
xlSheetWriteNum(sheet, 2, 0, 25.718, format[1])
xlSheetWriteNum(sheet, 3, 0, 25.718, format[2])
xlSheetWriteNum(sheet, 4, 0, 25.718, format[3])
xlSheetWriteNum(sheet, 5, 0, 25.718, format[4])
xlSheetWriteNum(sheet, 7, 0, 1800.5, format[5])
xlSheetWriteNum(sheet, 9, 0, 500, format[6])
xlSheetWriteNum(sheet, 10, 0, 1600, format[6])
xlSheetWriteStr(sheet, 11, 0,'Esta es una frase de prueba',0)

dateFormat = xlBookAddFormat(book, 0)
x := xlBookAddCustomNumFormat(book, "dd/mm/yyyy")
xlFormatSetNumFormat(dateFormat,x)
xlSheetWriteNum(sheet, 12, 0, xlBookDatePack(book, 2008, 4, 29, 0, 0, 0, 0),
dateFormat)

boldFont = xlBookAddFont(book, 0)
xlFontSetBold(boldFont, 1)

titleFont = xlBookAddFont(book, 0)
xlFontSetName(titleFont, "Arial Black")
xlFontSetSize(titleFont, 16)

titleFormat = xlBookAddFormat(book, 0)
xlFormatSetFont(titleFormat, titleFont)
xlFormatSetBorder(titleFormat, 1)
xlFormatSetFillPattern(titleFormat, 1)
xlFormatSetPatternForegroundColor(titleFormat,3)

xlSheetWriteStr(sheet, 15, 0, "Invoice No. 3568", titleFormat)
id = xlBookAddPicture(book,'c:\prueba.jpg')
xlSheetSetPicture(sheet,16,0,id,2)

xlBookSave(book, "c:\custom.xls")
xlBookRelease(book)


Hope this helps...

BR, Jan


Bernard Mouille

unread,
Mar 30, 2012, 10:46:33 AM3/30/12
to Harbour Users
hello Jan,

Thank you, have a good week-end.

Bernard

Randy

unread,
Mar 30, 2012, 11:02:14 AM3/30/12
to Harbour Users
Thanks Jan!

On Mar 30, 10:46 am, Bernard Mouille <bernard.moui...@wanadoo.fr>
wrote:
> > The has many more functions, but this all I need so far...- Hide quoted text -

rajesh nandwani

unread,
Aug 8, 2017, 4:31:47 PM8/8/17
to Harbour Users
thank you for the valuable information.
I am a bit new to using advanced features of Harbour. I tried to use libxl.lib to this code but it is not taking it. I think it is searching for .a file which we dont have.  So, How is .LIB file used in harbour, -llibxl does not work
Please help
Thanks and Regards

Srdjan

unread,
Mar 25, 2018, 5:20:30 PM3/25/18
to Harbour Users
I create harbour lib for creating xlsx file http://28406.s.t4vps.eu/xlsx.html
Example program in attachment.
create program with hbmk2 xlsxwriter.prg -lxlsxclass hbmzip.hbc
XLSXWriter.prg

Gabriel Ornelas

unread,
Mar 25, 2018, 7:44:46 PM3/25/18
to harbou...@googlegroups.com
Hi
This Example same with out ole, only using
\harbour-core\extras\hbxlsxml

  oXML:= ExcelWriterXML():New(cFile)
  oXML:setOverwriteFile(.t.)
  oXML:showErrorSheet( .T. )

  oSheet:= oXML:addSheet('Ventas por periodo')
  nLineas:= 0

  WITH OBJECT oXML:addStyle( 'totales' )
       :alignHorizontal( "Right" )
       :alignVertical( "Center" )
       :setNumberFormat( "#,##0.00" )
       :setFontName('Consolas')
       :setFontSize(12)
       :bgColor('#AEAAAA')
  END WITH
  WITH OBJECT oXML:addStyle( 'numberCan' )
       :alignHorizontal( "Right" )
       :alignVertical( "Center" )
       :setNumberFormat( "#,##0.00" )
       :setFontName('Consolas')
       :setFontSize(10)
  END WITH
  WITH OBJECT oXML:addStyle('numberx')
       :alignHorizontal( "Right" )
       :alignVertical( "Center" )
       :setNumberFormat( "#,##0.00" )
       :setFontName('Consolas')
       :setFontSize(10)
       :bgColor('#FF4500') // ROJO
  END WITH

  WITH OBJECT oXML:addStyle('Heads')
      :alignHorizontal('Center')
      :alignVertical('Center')
      :setFontName('Consolas')
      :setFontSize(10)
      :bgColor('#AEAAAA')
  END WITH
  WITH OBJECT oXML:addStyle('Celdas')
      :alignHorizontal('Left')
      :alignVertical('Center')
      :setFontName('Consolas')
      :setFontSize(10)
  END WITH
  WITH OBJECT oXML:addStyle('celdasx')
      :alignHorizontal('Left')
      :alignVertical('Center')
      :setFontName('Consolas')
      :setFontSize(10)
      :bgColor('#AEAAAA') // ROJO
  END WITH

  oSheet:writeString(++nLineas,1,"REPORTE DE VENTAS POR PRODUCTOS")
  oSheet:writeString(++nLineas,1,"POR FECHA DEL:"+StrTran(DToC(aParams[1]),"/","_")+"_al_"+StrTran(DToC(aParams[2]),"/","_") )
  oSheet:writeString(++nLineas,1,DToC( Date() ) + " " + Time() )

  oSheet:columnWidth( 1, 80 )
  oSheet:columnWidth( 2, 200 )
  oSheet:columnWidth( 3, 80 )
  oSheet:columnWidth( 4, 80 )
  oSheet:columnWidth( 5, 80 )

  aItems:= { "PRODUCTO", "DESCRIPCION DEL PRODUCTO","CANTIDAD","PRECIO","TOTAL" }

  ++nLineas
  ++nLineas
  FOR nCols:= 1 TO 5
      oSheet:writeString( nLineas, nCols, aItems[nCols], 'Heads' )
  NEXT
  oSQLDetalle:GoTop()
  cLinea:= "@"
  DO WHILE !oSQLDetalle:EOF()
     ++nLineas
     IF oSQLDetalle:id_linea!=cLinea
        ++nLineas
        oSheet:writeString( nLineas, 1, oSQLDetalle:id_linea+" "+oSQLDetalle:nombre_linea, 'celdasx' )
        cLinea:= oSQLDetalle:id_linea
        ++nLineas
     ENDIF
     oSheet:writeString( nLineas, 1, oSQLDetalle:id_producto, 'Celdas' )
     oSheet:writeString( nLineas, 2, oSQLDetalle:nombre_producto, 'Celdas' )
     oSheet:writeString( nLineas, 3, AllTrim(Str(oSQLDetalle:cantidad,10,2)), 'numberCan' )
     oSheet:writeString( nLineas, 4, AllTrim(Str(oSQLDetalle:precio_venta,13,2)), 'numberCan' )
     oSheet:writeString( nLineas, 5, AllTrim(Str(oSQLDetalle:total_partida,13,2)), 'numberCan' )
     oSQLDetalle:Skip()
  ENDDO
  WAITOFF()
  oXML:writeData( cFile )

  TRY
      oExcel := GetActiveObject( "Excel.Application" )
  CATCH
     TRY
        oExcel := CreateObject( "Excel.Application" )
     CATCH
        Alert( "ERROR! Excel not available. [" + Ole2TxtError()+ "]" )
        RETURN .F.
     END
  END
  oExcel:WorkBooks:Open( cFile )
  oExcel:visible:= .T.
  oExcel:= NIL

Best Regards
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Srdjan

unread,
Mar 26, 2018, 2:15:25 AM3/26/18
to Harbour Users
I did not see this. :) I trained my brain a bit and read a lot about XLSX format. In the end, this (http://28406.s.t4vps.eu/xlsx.html) is a little different from this in extras

jparada

unread,
Apr 5, 2018, 11:31:23 PM4/5/18
to Harbour Users
Hi,

Any help how can I set borders around the cells with hbxlsxml

I appreciate your help.

Regards,
Javier

Srdjan

unread,
Apr 6, 2018, 12:56:08 AM4/6/18
to Harbour Users
I add header and footer definition in my xlsxclass. example in attachment

בשנה הבאה בקוסובו
XLSXWriter.prg

Fausto Trautwein

unread,
Apr 6, 2018, 8:23:35 AM4/6/18
to Harbour Users
Hi,

Please try borders in the style, example:

WITH OBJECT oXML:addStyle( 'totales' )
       :alignHorizontal( "Right" )
       :alignVertical( "Center" )
       :setNumberFormat( "#,##0.00" )
       :setFontName('Consolas')
       :setFontSize(12)
       :bgColor('#AEAAAA')
       :border('All',1,,'Continuous')
END WITH

--------------------------------
From the class. Comments are from de php original class.

    // Change Border
    /**
     * Sets the border for the named style.
     * This function can be called multiple times to set different sides of the
     * cell or set all sides the same at once.
     * @param string $position Sets which side of the cell should be modified.
     * Acceptable values are "All" "Left" "Top" "Right" "Bottom" "DiagonalLeft"
     * "DiagonalRight"
     * @param integer $weight Thickness of the border.  Default is 1 "Thin"
     * @param string $color Color of the border. Default is "Automatic" but any
     * 6-hexadecimal digit number in "#rrggbb" format or it can be any of the
     * Microsoft® Internet Explorer named colors
     * @param string $linestyle Type of line to use on the border.
     * Default is "Continuous".  Acceptable balues are "None" "Continuous"
     * "Dash" "Dot" "DashDot" "DashDotDot" "SlantDashDot" "Double"
     */
METHOD border(position,weight,color,linestyle) CLASS ExcelWriterXML_Style

Regards,

Fausto Di Creddo Trautwein

Fausto Trautwein

unread,
Apr 6, 2018, 8:31:12 AM4/6/18
to Harbour Users
Hi,

Another option to write xlsx files:

Srdjan

unread,
Apr 6, 2018, 9:36:10 AM4/6/18
to Harbour Users
John McNamara library have problem with borders around merged cells. 

Srdjan

unread,
Apr 6, 2018, 9:43:59 AM4/6/18
to Harbour Users
In attachment is shell for John McNamara library.
xlsx.c

Fausto Trautwein

unread,
Apr 6, 2018, 9:53:01 AM4/6/18
to Harbour Users
This is great.

jparada

unread,
Apr 6, 2018, 11:42:20 AM4/6/18
to Harbour Users
Hi,

I have tried according to the example, but if I add this line:

oObj := oXml:addStyle( "textLeftBold" )
oObj:alignHorizontal( "Left" )
oObj:alignVertical( "Center" )
oObj:fontSize( 10 )
oObj:border( "All",1,,"Continuous" )
oObj:setFontBold()

An error happens, I mean, compile without error with hbmk2 example.prg, 
but when running example.exe it generates this error:

Error BASE/1004  No exported method: KEY
Called from KEY(0)
Called from EXCELWRITERXML_STYLE:GETSTYLEXML(236)
Called from EXCELWRITERXML:WRITEDATA(281)
Called from MAIN(266)

What Am I doing wrong?

I appreciate your help.

Regards,
Javier

Fausto Trautwein

unread,
Apr 6, 2018, 12:51:49 PM4/6/18
to Harbour Users
Please change xlsxml_y.prg, line 236

from

      FOR EACH auxdata IN positions
         position := auxdata:Key
         pData    := auxdata:Value

to

      FOR EACH auxdata IN positions
           position:= auxdata:__enumKey()
           pData   := auxdata:__enumValue()

Fausto

jparada

unread,
Apr 8, 2018, 7:09:20 PM4/8/18
to Harbour Users
Hi Fausto,

It worked very well, thanks.

I appreciate your help.

Regards,
Javier

Srdjan

unread,
Apr 9, 2018, 4:03:40 AM4/9/18
to Harbour Users
Fausto are you create library from McNamara sources for Windows? I can't create library for Windows only for Linux.

Fausto Trautwein

unread,
Apr 9, 2018, 7:38:16 AM4/9/18
to Harbour Users
Yes, I did it for windows. I needed to generate a huge xlsx file and found libxlsxwriter. I only knew how to access the dll from harbour, not the c stuff. 

After your e-mail with xlsx.c I started to create a lib like hblibxlxswriter but without using the dll and I believe it will be easier to use on linux.

Although I'm struggling with c code, it´s already possible to run all examples from hblibxlsxwriter but the charts ones.

Regards,

Fausto

Srdjan

unread,
Apr 9, 2018, 9:04:42 AM4/9/18
to Harbour Users

Srdjan

unread,
Apr 9, 2018, 9:07:22 AM4/9/18
to Harbour Users
Now I publish my XLSX Class in pure Harbour and example.
XLSXClass.prg
XLSXWriter.prg

Srdjan

unread,
Apr 9, 2018, 9:15:54 AM4/9/18
to Harbour Users
for example in last post: hbmk2 xlsxwriter.prg xlsxclass.prg hbmzip.hbc 

bpd...@apollo.co.in

unread,
Apr 10, 2018, 2:47:08 AM4/10/18
to Harbour Users
Fantastic
Thank you for sharing 

Attila Szabó

unread,
Apr 11, 2018, 2:43:48 AM4/11/18
to Harbour Users
Hi Srdjan,

Great job!
Thank you for sharing.
There may be some description or documentation or reference manual for this?

Best Regards,
Attila

Srdjan

unread,
Apr 11, 2018, 3:00:55 AM4/11/18
to Harbour Users
Hi Atila,

I did this in the last month. I hope to add some more options (inserting pictures and charts). I did it for myself, so there is no documentation. Just this example. If you need free ask. :)

Srdjan

Attila Szabó

unread,
Apr 11, 2018, 4:14:49 AM4/11/18
to Harbour Users
Hi Srdjan,

Thanks. Already the source code is a great help. :)

Attila

Attila Szabó

unread,
Apr 11, 2018, 4:37:32 AM4/11/18
to Harbour Users
Hi Srdjan,

Can you resolve that "OpenOffice Calc" should also open the XLSX file correctly?

Attila
OpenOffice_Screen.png
Excel_Screen.png

Srdjan

unread,
Apr 11, 2018, 5:27:39 AM4/11/18
to Harbour Users
Hi Attila,

I have LibreOffice. Test and work OK

Srdjan
Screenshot 2018-04-11 11.25.32.png

Attila Szabó

unread,
Apr 11, 2018, 7:19:37 AM4/11/18
to Harbour Users
Hi Srdjan,

That's great. Thank You. :)

Attila

Angel Pais

unread,
Apr 11, 2018, 9:19:17 AM4/11/18
to harbou...@googlegroups.com
It works with WPS Office too !

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.

jparada

unread,
May 31, 2018, 7:48:25 PM5/31/18
to Harbour Users
Hi,

Is there some way to freeze panels?.

I appreciate any help.

Regards,
Javier

Fausto Trautwein

unread,
Jun 1, 2018, 9:30:45 AM6/1/18
to Harbour Users
Hi,

lxw_worksheet_freeze_panes(worksheet, row, col)


Regards

Fausto

jparada

unread,
Jun 3, 2018, 5:00:26 PM6/3/18
to Harbour Users
Hi,

I'm a bit confused, I'm trying with the hbxlsxml library, and you're talking about hblibxlsxwriter, can I mix both libraries?, and if yes, how?.

I appreciate your help, and please if possible, an example with the hbxlsxml library.

Regards,
Javier

Fausto Trautwein

unread,
Jun 3, 2018, 7:06:03 PM6/3/18
to Harbour Users
Sorry my mistake. 

You cannot mix both libraries.

AFAIK with hbxlsxml is not possible to freeze panels.

Regards,

Fausto.

Jorge Benavides

unread,
Sep 26, 2018, 11:29:54 AM9/26/18
to Harbour Users
Hi, while trying the class i got an autocomplete, is there a way to stop these??
and thanks for sharing.

Srdjan

unread,
Sep 26, 2018, 12:35:31 PM9/26/18
to Harbour Users
Are you use Fausto or my class ?

Jorge Benavides

unread,
Sep 26, 2018, 1:00:45 PM9/26/18
to Harbour Users
hi Srdjan.
I'm using your class.

Srdjan

unread,
Sep 26, 2018, 1:05:36 PM9/26/18
to Harbour Users
Please send me small example. Which spreadsheet program you use?

Jorge Benavides

unread,
Sep 26, 2018, 2:07:50 PM9/26/18
to Harbour Users
Hi the file is compiled in hmg3.4.3 and i am implementing your class en a excel example that i already had.
fist of all check the time difference.
great class.
Grid2Excel.zip

Jorge Benavides

unread,
Sep 29, 2018, 4:32:27 PM9/29/18
to Harbour Users
hi Srdjan.
I been trying to find a way to fix my problem with auto completion and modify a couple  of lines and i like to know if you get the same results.
added from line 521 throw 524 and lines 614 and 621 i didn't want to have problems further on the code.
Regards.
XLSXClass.prg

Srdjan Dragojlovic

unread,
Sep 29, 2018, 5:33:18 PM9/29/18
to harbou...@googlegroups.com
Thank you Jorge !
I'll try but not find why way for this.

Best regards,

Srdjan Dragojlovic, dipl.ing.el.
www.sokdoo.com
www.jeftinastruja.biz
http://www.facebook.com/pages/SOK-doo/197699000254120
+38163683093
+13072787086

--------------------------------------------
On Sat, 9/29/18, Jorge Benavides <jorgeab...@gmail.com> wrote:

Subject: Re: [harbour-users] Re: Read/write XLS without OLE
To: "Harbour Users" <harbou...@googlegroups.com>
Date: Saturday, September 29, 2018, 10:32 PM

hi
Srdjan.I been trying to
find a way to fix my problem with auto completion and modify
a couple  of lines and i like to know if you get the same
results.added from line 521
throw 524 and lines 614 and 621 i didn't want to have
problems further on the
code.Regards.
El miércoles,
26 de septiembre de 2018, 13:07:50 (UTC-5), Jorge Benavides
escribió:Hi the file is
compiled in hmg3.4.3 and i am implementing your class en a
excel example that i already had.fist of all
check the time difference.great
class.

El
miércoles, 26 de septiembre de 2018, 12:05:36 (UTC-5),
Srdjan escribió:Please send me small
example. Which spreadsheet program you use?

On Wednesday, September 26,
2018 at 7:00:45 PM UTC+2, Jorge Benavides wrote:hi Srdjan.I'm
using your class.
El miércoles, 26 de
septiembre de 2018, 11:35:31 (UTC-5), Srdjan
escribió:Are you use Fausto
or my class ?






--

--

You received this message because you are subscribed to the
Google

Groups "Harbour Users" group.

Unsubscribe: harbour-user...@googlegroups.com

Web: http://groups.google.com/group/harbour-users



---

You received this message because you are subscribed to the
Google Groups "Harbour Users" group.

To unsubscribe from this group and stop receiving emails
from it, send an email to harbour-user...@googlegroups.com.

Jorge Benavides

unread,
Sep 30, 2018, 6:49:00 PM9/30/18
to Harbour Users
Hi
Yes is the ascan it return a result positive when is not an exact match.
I added a line to force exact.
Regards.

fvit

unread,
Oct 2, 2018, 12:54:37 PM10/2/18
to Harbour Users
#pragma BEGINDUMP
#include "hbapi.h"

HB_FUNC( WORKSHEET_RC )
{
  const char *cellAddr = hb_parc(1);
  int ii=0, jj, colVal=0;
  while(cellAddr[ii++] >= 'A') {};
  ii--;
  for(jj=0;jj<ii;jj++) colVal = 26*colVal + HB_TOUPPER(cellAddr[jj]) -'A' + 1;
  hb_storni( atoi(cellAddr+ii), 2 );
  hb_storni( colVal, 3 );
}

#pragma ENDDUMP

First of all thank you Srdjan, really a great class!

I have done two very small changes to avoid some compiling warnings using MinGW 8.10 on Windows 64.

Just added the "const" clause and renamed "toupper" with "HB_TOUPPER"

I'm using Viktor Harbour 3.4.

If someone can find this useful... just my two cents :)

Regards

p.s.: please, if someone has more examples using this class can post here the code ? 
I have just discovered it, and I'm quite new working with it.
Thank you in advance!

Diego Fazio

unread,
Oct 2, 2018, 1:14:39 PM10/2/18
to Harbour Users
Excellent!
Thanks

Diego.

Srdjan

unread,
Oct 2, 2018, 2:21:44 PM10/2/18
to Harbour Users
I build this class for one my program. 
I have power supply company and need billing system. First when I have small customer and I build invoices manually in Excel. When I get many customers I need made my billing system with this class. First I use OLE but OLE is very very slow.  
I want picture and graph into this class but I'm not only programmer and have other business :)
Ask how to do something, maybe we have a solution :) 

fvit

unread,
Oct 2, 2018, 2:59:11 PM10/2/18
to Harbour Users
Thanks Srdjan for the quick reply :)
I have a very similar need too, I want to use your class to generate invoices and also, in another project, to "print" data tables (.dbf files and/or sql tables) on a .xlsx spreadsheet formatted in a "pretty" way.
I'm not a C programmer unfortunately, I would need the graph/picture feature too (for the logo picture to put in the invoice...):)
I hope someone can implement it in the future, I really understand that you have other priorities (your business).
Your class is a huge step forward compared to OLE...
I'm really grateful for your contribution.
Bye and thank you again.

Srdjan

unread,
Jan 21, 2020, 4:23:37 PM1/21/20
to Harbour Users
Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

logo.png
XLSXClass.prg
xlsxwriter.hbp
XLSXWriter.prg

Riztan Gutierrez

unread,
Jan 21, 2020, 11:40:03 PM1/21/20
to harbou...@googlegroups.com
Srdjan, very thanks

With your permission, I will try to adapt your class at https://github.com/riztan/hbxlsxwriter

Fausto, also thanks for your work.

Regards

El mar., 21 ene. 2020 a las 17:23, 'Srdjan' via Harbour Users (<harbou...@googlegroups.com>) escribió:
Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.


--


 Riztan Gutiérrez                     www.gtxbase.org                              www.gtkbase.org

  • Linux User: # 494267
  • Ubuntu User: # 28329


Srdjan

unread,
Jan 22, 2020, 12:33:32 AM1/22/20
to Harbour Users
Ok Ritzan.

On Wednesday, January 22, 2020 at 5:40:03 AM UTC+1, Riztan Gutierrez wrote:
Srdjan, very thanks

With your permission, I will try to adapt your class at https://github.com/riztan/hbxlsxwriter

Fausto, also thanks for your work.

Regards

El mar., 21 ene. 2020 a las 17:23, 'Srdjan' via Harbour Users (<harbou...@googlegroups.com>) escribió:
Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Paola Bruccoleri

unread,
Jan 23, 2020, 1:03:08 PM1/23/20
to harbou...@googlegroups.com
Hi Srdjan
I am using your class .. the work is very good.

I see that to add a dat to a cell the cell address is used, for example H4.
How could something generic be done to use rows and columns that change? But it would be necessary to invent some function that had the letters of the columns to be able to cross them.
If someone comes up with a better idea, welcome!
Thank you



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Martes, 21 de Enero 2020 18:23:37
Asunto: [harbour-users] Re: Read/write XLS without OLE


Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Srdjan

unread,
Jan 23, 2020, 2:00:54 PM1/23/20
to Harbour Users
oDrawing:TwoCellAnchor( "A13", "C17",  cPath )
A13 left-top cell
C17 dow-right cell


default value of editAs property have value "absolute"

Specifies how the object should be moved and/or resized when the rows and columns between the start and end anchors are resized, or when additional rows or columns are added. Possible values are

  • absolute - do not move or resize with the underlying rows/columns. The current start and end positions are maintained; if additional rows or columns are added, the object anchors are moved as needed to maintain the same position.
  • oneCell - move with the cells but do not resize. If additional rows or columns are added, the object anchors are moved as needed to maintain the same position.
  • twoCell - move and resize with the anchor cells.

On Thursday, January 23, 2020 at 7:03:08 PM UTC+1, Paola Bruccoleri wrote:
Hi Srdjan
I am using your class .. the work is very good.

I see that to add a dat to a cell the cell address is used, for example H4.
How could something generic be done to use rows and columns that change? But it would be necessary to invent some function that had the letters of the columns to be able to cross them.
If someone comes up with a better idea, welcome!
Thank you



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Martes, 21 de Enero 2020 18:23:37
Asunto: [harbour-users] Re: Read/write XLS without OLE

Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Srdjan

unread,
Jan 23, 2020, 2:33:43 PM1/23/20
to Harbour Users
Class have properties for TwoCellAnchor method:
nOffColFrom
nOffRowFrom
nOffColTo
nOffRowTo 

offset in EMU for both corners of drawing.
1mm= 36000EMU

I learn from this:

On Thursday, January 23, 2020 at 7:03:08 PM UTC+1, Paola Bruccoleri wrote:
Hi Srdjan
I am using your class .. the work is very good.

I see that to add a dat to a cell the cell address is used, for example H4.
How could something generic be done to use rows and columns that change? But it would be necessary to invent some function that had the letters of the columns to be able to cross them.
If someone comes up with a better idea, welcome!
Thank you



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Martes, 21 de Enero 2020 18:23:37
Asunto: [harbour-users] Re: Read/write XLS without OLE

Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Srdjan

unread,
Jan 23, 2020, 4:32:26 PM1/23/20
to Harbour Users
Hi Paola,
Address of cell can be array { row, col }, rov>0, col>0

METHOD Cell( uAddr, xValue, nStyle ) CLASS WorkSheet
LOCAL nCol := 0, nRow := 0, i, j, k, l, lIsMerge := .F., nRow1 := 0, nCol1 := 0, nRow2 := 0, nCol2 := 0

IF HB_ISARRAY( uAddr )
    nRow := uAddr[1]
    nCol := uAddr[2]
ELSE
    WORKSHEET_RC( uAddr, @nRow, @nCol )
ENDIF


On Thursday, January 23, 2020 at 7:03:08 PM UTC+1, Paola Bruccoleri wrote:
Hi Srdjan
I am using your class .. the work is very good.

I see that to add a dat to a cell the cell address is used, for example H4.
How could something generic be done to use rows and columns that change? But it would be necessary to invent some function that had the letters of the columns to be able to cross them.
If someone comes up with a better idea, welcome!
Thank you



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Martes, 21 de Enero 2020 18:23:37
Asunto: [harbour-users] Re: Read/write XLS without OLE

Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Paola Bruccoleri

unread,
Jan 23, 2020, 6:29:44 PM1/23/20
to harbou...@googlegroups.com
Hi Srdjan

I need a function ColumnLetterToColumnIndex(colLetter)
I'm in it, but if it's already somewhere, better
very thanks



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Jueves, 23 de Enero 2020 18:32:26
Asunto: Re: [harbour-users] Re: Read/write XLS without OLE

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/5c7b20e8-bab6-4f67-8cae-5c0beb067e24%40googlegroups.com.

Paola Bruccoleri

unread,
Jan 23, 2020, 7:09:15 PM1/23/20
to harbou...@googlegroups.com
Hi!

I am trying to pass data from a database to xlsx and there are numeric fields that record it with 0 in the cell. I think there is a problem with the Cell method.
oSheet1: Cell ("G10", orders-> val_orden, nStyle1)

It is not a problem with the data in the table because I have already tried everything. I even have some other values of totals in variables and some records them well and others in 0.

I have no idea what else to try ...




De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Jueves, 23 de Enero 2020 18:32:26
Asunto: Re: [harbour-users] Re: Read/write XLS without OLE

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/5c7b20e8-bab6-4f67-8cae-5c0beb067e24%40googlegroups.com.

Paola Bruccoleri

unread,
Jan 23, 2020, 7:55:42 PM1/23/20
to harbou...@googlegroups.com
I have problems with negative numbers with decimals..


the selected cell have -9950,55
the other values at 0 are also negative values



De: "Paola Bruccoleri" <pbruc...@adinet.com.uy>
Para: harbou...@googlegroups.com
Enviados: Jueves, 23 de Enero 2020 21:08:58
undefined
11308480
undefined

Srdjan

unread,
Jan 24, 2020, 1:42:43 AM1/24/20
to Harbour Users
Problem with negative number is solved

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbou...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.
XLSXClass.prg

Srdjan

unread,
Jan 24, 2020, 8:50:01 AM1/24/20
to Harbour Users
FUNCTION ColumnLetterToColumnIndex(cCol)
LOCAL nCol := 0,c
cCol:=UPPER(cCol)
FOR I:=1 TO LEN(cCol)
    IF ASC(SUBSTR(cCol,I,1))<65 .OR. ASC(SUBSTR(cCol,I,1))>90; cCol := ""; ENDIF
NEXT I
FOR I:=1 TO LEN(cCol)
    c=SUBSTR(cCol,LEN(cCol)-I+1,1)
    nCol += (ASC(c)-64)*26^(I-1)
NEXT I
RETURN nCol

Paola Bruccoleri

unread,
Jan 24, 2020, 10:05:21 AM1/24/20
to harbou...@googlegroups.com
Hello Srdjan
very thanks, but... now the problem is with integer negative numbers!




De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 3:42:42

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/7d042c6d-2059-44a1-a916-25b1de49bc3f%40googlegroups.com.

undefined
1346743
undefined

Paola Bruccoleri

unread,
Jan 24, 2020, 10:07:02 AM1/24/20
to harbou...@googlegroups.com
very thanks... Last night I finished doing a similar function! ;)
but I keep this



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 10:50:01

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/714ed516-92e6-4a1f-ba5c-679dcdc97030%40googlegroups.com.

Paola Bruccoleri

unread,
Jan 24, 2020, 10:23:24 AM1/24/20
to harbou...@googlegroups.com
Hello Srdjan  (I already learned to write your name! Hard to read for those of us who speak Spanish :) )

Changing this:
v := ALLTRIM( BestPrecision(::aData[I,J]) )
For this
v := alltrim(str(::aData[I,J])) 

It seems that everything works ok, but I don't know if it can lead to other problems. I don't know what the BestPrecision functionality would be





Enviados: Viernes, 24 de Enero 2020 12:05:05

Srdjan

unread,
Jan 24, 2020, 10:25:20 AM1/24/20
to Harbour Users
Now work with all negative numbers :)
XLSXClass.prg

Srdjan

unread,
Jan 24, 2020, 10:56:21 AM1/24/20
to Harbour Users
My name is Srđan (or Srdjan if use only ASCII)

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbou...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Srdjan

unread,
Jan 24, 2020, 11:04:10 AM1/24/20
to Harbour Users
best solution is
v := HB_NTOS(::aData[I,J])

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbou...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Srdjan

unread,
Jan 24, 2020, 11:20:51 AM1/24/20
to Harbour Users
I don't know HB_NTOS function because I create BestPrecision function
Please see this example

PROCEDURE Main()
LOCAL n := ( 5 / 2 ) + 0.009
? hb_ntoc( n )     // --> 2.509
? Str( n )         // -->          2.51
? hb_ntoc( n, 2 )  // --> 2.51
? Str( n, 5, 2 )   // -->  2.51
? hb_ntos( n )     // --> 2.51
RETURN

Paola Bruccoleri

unread,
Jan 24, 2020, 12:31:58 PM1/24/20
to harbou...@googlegroups.com
Hi..

I use this sentence: HB_NTOS.
I continue testing the class ...
Now the problem is to write words with tilde. If you put a word with a tilde in a cell, the following strings are not recorded.

without tilde, OK


If I write "Retención", the sintax correct, the string and the following are not written, even if they have no tilde







De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 13:04:10

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/3922a0e8-78f5-495e-be78-076474390489%40googlegroups.com.

undefined
undefined
10074027
undefined
9937637
undefined

Srdjan

unread,
Jan 24, 2020, 12:52:40 PM1/24/20
to Harbour Users
For me tilda is ~ :)
Is ó tilda ?

Srdjan

unread,
Jan 24, 2020, 12:55:18 PM1/24/20
to Harbour Users
Please give mi example.
I write this and all OK.
oSheet1:Cell("I11", "Retención" )

On Monday, March 26, 2012 at 8:44:56 PM UTC+2, Randy wrote:
Hi all,

Does anyone have any experience reading/writing Excel XLS/XLSX files
from Harbour in a server environment _without_ using OLE? (As of
Office 2007, OLE is no longer supported in a server environment when
there is no user logged on).

Thanks!

Randy.

Paola Bruccoleri

unread,
Jan 24, 2020, 1:45:51 PM1/24/20
to harbou...@googlegroups.com
I have no idea what happens. There are longer strings that do not record them either ... but I try it in your example and it works without problem ..
I will continue testing these days to see if I find what configuration of my system is complicating this



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 14:55:18

Asunto: [harbour-users] Re: Read/write XLS without OLE

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/8bbde675-09ce-40f6-8faf-2e45780d0ad1%40googlegroups.com.

Srdjan

unread,
Jan 24, 2020, 1:50:50 PM1/24/20
to Harbour Users
My example is written with the UTF-8 code page.
You probably use the Spanish code page.

On Friday, January 24, 2020 at 7:45:51 PM UTC+1, Paola Bruccoleri wrote:
I have no idea what happens. There are longer strings that do not record them either ... but I try it in your example and it works without problem ..
I will continue testing these days to see if I find what configuration of my system is complicating this



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 14:55:18
Asunto: [harbour-users] Re: Read/write XLS without OLE

Please give mi example.
I write this and all OK.
oSheet1:Cell("I11", "Retención" )

On Monday, March 26, 2012 at 8:44:56 PM UTC+2, Randy wrote:
Hi all,

Does anyone have any experience reading/writing Excel XLS/XLSX files
from Harbour in a server environment _without_ using OLE? (As of
Office 2007, OLE is no longer supported in a server environment when
there is no user logged on).

Thanks!

Randy.

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Paola Bruccoleri

unread,
Jan 24, 2020, 2:10:58 PM1/24/20
to harbou...@googlegroups.com
Yes, I thought about that. But I took this out of your code and it works the same way.
hb_cdpSelect( 'UTF8EX' )

In my code has:

REQUEST HB_LANG_ESWIN
REQUEST HB_CODEPAGE_ES850
HB_CDPSELECT('ES850')
HB_LANGSELECT('ESWIN')

but I deleted it and I still have the same problem...



De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 15:50:50
Asunto: Re: [harbour-users] Re: Read/write XLS without OLE

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/d52f6299-0556-41d8-9db2-8ea93a9c74e5%40googlegroups.com.

Srdjan

unread,
Jan 24, 2020, 2:23:53 PM1/24/20
to Harbour Users
Please send me your prg example and created xlsx file with error.

Paola Bruccoleri

unread,
Jan 27, 2020, 10:02:28 AM1/27/20
to harbou...@googlegroups.com
Hi Srdjan
I'm going to try some more things and try to make an example to send you.
Thank you


De: "'Srdjan' via Harbour Users" <harbou...@googlegroups.com>
Para: "Harbour Users" <harbou...@googlegroups.com>
Enviados: Viernes, 24 de Enero 2020 16:23:53

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/8e917e43-c761-4e31-ad55-4ea0c34ce98e%40googlegroups.com.

Attila Szabó

unread,
Feb 4, 2020, 2:20:45 AM2/4/20
to Harbour Users
Hi Srdjan,

It is possible to increase the row height?

Regards,
Attila
row_height.png

Srdjan Dragojlovic

unread,
Feb 4, 2020, 2:49:42 AM2/4/20
to harbou...@googlegroups.com
I try to solve this

Sent from my iPhone

On 4 Feb 2020, at 08:20, Attila Szabó <sza...@gmail.com> wrote:


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Attila Szabó

unread,
Feb 4, 2020, 2:54:43 AM2/4/20
to Harbour Users

Thanks! That would be great!

Regards,
Attila


2020. február 4., kedd 8:49:42 UTC+1 időpontban Srdjan a következőt írta:
I try to solve this

Sent from my iPhone

On 4 Feb 2020, at 08:20, Attila Szabó <sza...@gmail.com> wrote:


Hi Srdjan,

It is possible to increase the row height?

Regards,
Attila

2020. január 21., kedd 22:23:37 UTC+1 időpontban Srdjan a következőt írta:
Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Attila Szabó

unread,
Feb 4, 2020, 3:08:22 AM2/4/20
to Harbour Users
Hi Srdjan,

Another little problem would be:

oExcel := WorkBook():New("sample.xlsx")
   works well, but
oExcel := WorkBook():New("D:\myPath\sample.xlsx")
   does not work

Why can't the filename contain a path?

Regards,
Attila

2020. február 4., kedd 8:49:42 UTC+1 időpontban Srdjan a következőt írta:
I try to solve this

Sent from my iPhone

On 4 Feb 2020, at 08:20, Attila Szabó <sza...@gmail.com> wrote:


Hi Srdjan,

It is possible to increase the row height?

Regards,
Attila

2020. január 21., kedd 22:23:37 UTC+1 időpontban Srdjan a következőt írta:
Pure Harbour XLSX writer class with drawing (beta version)
Work with Libreoffice calc but not always with Excel 

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Paola Bruccoleri

unread,
Feb 4, 2020, 7:37:06 AM2/4/20
to harbou...@googlegroups.com
Hi Srdjan

Could you see the problem I have when I type letters with tilde?
Very thanks
byeee



De: "'Srdjan Dragojlovic' via Harbour Users" <harbou...@googlegroups.com>
Para: harbou...@googlegroups.com
Enviados: Martes, 4 de Febrero 2020 4:47:35

Asunto: Re: [harbour-users] Re: Read/write XLS without OLE

Vikram Chhajer

unread,
Feb 4, 2020, 9:32:55 AM2/4/20
to Harbour Users
Hello Sir

While Compling getting this error


Lines 1784, Functions/Procedures 32
Generating C source output to '.hbmk\win\mingw\xlsxclass.c'... Done.
hbmk2: Compiling...
hbmk2: Linking... main.exe
.hbmk/win/mingw/xlsxclass.o:xlsxclass.c:(.data+0x418): undefined reference to `HB_FUN_HB_DIRREMOVEALL'
collect2: ld returned 1 exit status
hbmk2[main]: Error: Running linker. 1
gcc.exe .hbmk/win/mingw/xlsxwriter.o .hbmk/win/mingw/xlsxclass.o .hbmk/win/mingw/_hbmkaut_xlsxwriter.o    -Wl,--nxcompat -Wl,--dynamicbase -mwindows -Wl,--start-group -lhbnf -lhbformat -lhbfoxpro -lxhb -lhbct -lhbtip -lhbfship -lhbxpp -lhbwin -lpng -lhbziparc -lhbmzip -lminizip -lhbhpdf -llibhpdf -lhbzebra -lhbssl -lssleay32 -llibeay32 -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib   -Wl,--end-group -omain.exe  -Lc:/hb32/lib/win/mingw

hbmk2: Error: Referenced, missing, but unknown function(s): HB_DIRREMOVEALL()

Paola Bruccoleri

unread,
Feb 6, 2020, 10:10:08 AM2/6/20
to harbou...@googlegroups.com
Hi Srdjan

Mi friend "clippero" suggest this for me
HB_TRANSLATE('Retención','ESWIN', 'UTF8EX')

and works ok in my system
very thanks clippero!!!
byeeee




De: "Paola Bruccoleri" <pbruc...@adinet.com.uy>
Para: harbou...@googlegroups.com
Enviados: Martes, 4 de Febrero 2020 9:36:53
Reply all
Reply to author
Forward
0 new messages