Can someone indicate/advice me a good library capable to access, create and manipulate Excel sheets? BTW, I would prefer a .DLL library, because it's easier/faster to wrap its C functions using NTK's '_DLL32...' or 'DECLARE FUNC...' command. Anyway, a good ActiveX control would be ok too!
Direct reading and writing Excel files LibXL is a library that can read and write Excel files. It doesn't require Microsoft Excel and combines an easy to use and powerful features. Library can be used to
* Generate a new spreadsheet from scratch * Extract data from an existing spreadsheet * Edit an existing spreadsheet
LibXL can help your applications in exporting and extracting data to/from Excel files with minimum effort. Also it can be used ever as report engine. Library can be used in C, C++, C#, Delphi, Fortran and other languages.
Supports Excel 97-2003 binary formats (xls) and Excel 2007/2010 xml formats (xlsx). Supports Unicode and 64-bit platforms. There are a wrapper for .NET developers and separate Mac and Linux edition. Simple interoperate, no more Excel dependency LibXL has C/C++ headers, Delphi unit and .NET assembly for including in your project. No OLE automation.
Customizing the look and feel LibXL supports numerous formatting options: alignments, borders, colors, fill patterns, fonts, merging cells and so on.
High performance Writing speed is about 2 100 000 cells per second for numbers and 240 000 cells per second for 8-character random strings in binary format (CPU 3.2 GHz).
Royalty-free distribution with your application Our customers can use this library in theirs commercial applications without any fees.
/* * clipwks * purpose: to convert a Clipper numeric to spreadsheet format * syntax: IEEREAL( nValue ) * returns: char string of length 8. each char in string represents * the appropriate byte of nIEEVar. */
#pragma BEGINDUMP
#include <hbapi.h>
union { double n; char s[8]; } v;
HB_FUNC( IEEREAL ) { double n;
n = hb_parnd(1);
hb_retclen( (char *) &n, 8); }
/* * clipwks * purpose: to convert a spreadsheet string into its numeric value * syntax: realiee( cIEEStr ) * returns: nValue */
I suspect your are seeing only int values? I´m not really sure if this CTYPE_DOUBLE (parameter 4) is right... I had to change it to a floating type.
I´m not really sure why do you use the IEEREAL function... Should work without it, if setting the 4' parameter to floating. Also, I recommend to use the following line to write dates to the XLS: xlSheetWriteNum(::sheets[::ActSheet],y,x,xlBookDatePack(::book,xyear,xmonth,xday,0,0,0,0),xFormat)
Congratulations Bxed! You've done a great job. Many thanks for sharing your knowlege with other NTK community members. I'm sure many of them will be interested in your work.
Cheers, JN
P.S Do you see any drawback if I publish a copy of your contribution in the dedicated 'NTK - Knowledge Sharing' section of this newsgroup?
Hi Tom: Thx for this information, sounds interesting. But afaik ZetExcel is mainly for .NET and VB.NET. However, I've been told it could be also driven via COM/ACTIVEX - so just wondering if, alike BXED for LIBXL, you could share with us your NTK-wrapper source code, as well as a basic Test.PRG sample that shows how to proceed?