Wrapper for libxl, Apache POI or OpenOffice?

Just starting out? Need help? Post your questions and find answers here.
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

I'm looking to use an Excel spreadsheet as a template and fill it with data.
I don't want to have to have Excel present to pull this off.

I can use the OpenOffice automation bridge on Windows to do this, but frankly, I'd like to be able to make this work in Linux as well and usually in Linux/Mac OSX OpenOffice uses either a steam or socket to transact API control.

Since I don't want to have Excel, using VBA (even though Mac Office 2011 has VBA again) doesn't help. It also doesn't help there's no Linux version of Microsoft Office at all.

I've been digging around and the choices seem to be to wrap all or part of Apache POI:
http://poi.apache.org/

Create a socket based wrapper for OpenOffice (which will work in Windows, I just tested it very simply):
http://www.openoffice.org/
http://www.documentfoundation.org/

I found a product called OfficeWriter that's .NET and really server oriented so not what I really want:
http://officewriter.softartisans.com/

However, I found LibXL and being a C library with the headers I'm wondering as well if someone here has already wrapped it?
http://libxl.com/

The upside for LibXL would be they offer it on Linux, Mac OSX and Windows and they offer each platform at $200 for the license which isn't too bad for the amount I'm planning on using it (I have no relation to this company and am not currently a customer).

Thanks for any help in this regard...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by IdeasVacuum »

Well, sRod has written a grid gadget for Windows, and he supplies the PB source code with it. Perhaps you can ask sRod if the source is adaptable for Mac and Linux.

http://www.purebasic.fr/english/viewtopic.php?t=26647
http://www.nxsoftware.com/
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

IdeasVacuum wrote:Well, sRod has written a grid gadget for Windows, and he supplies the PB source code with it. Perhaps you can ask sRod if the source is adaptable for Mac and Linux.
I'm aware of this software, in fact I've been in communication with him recently about it.

The problem I have is that I need the result to be in Microsoft Excel and I need the template to be in Microsoft Excel.

I have a very good reason for this. It means that anyone with Excel can make or alter the template and they can export the results into the template so it looks nice. If I used the other method the current best I could do is export a CSV file. However then I'd need some VBA to integrate it. I absolutely need the end result in Excel for a particular set of projects. Otherwise I could use QuickPDF or NXSoftware's Artic Reporting. QuickPDF you could probably create a PDF template for with PDFill (under $35). However, the report design tool Pyrex for Artic Reporting is not a standard so far as I know and it's not royalty free to distribute (under $65).

Since I need Microsoft Excel output anyway, I figured for the modest effort using Excel to make the template would do the trick. In that sense I could even use OpenOffice to make the template or look at the results (assuming the template doesn't exploit some bizarre Excel feature OpenOffice/LibreOffice can't handle yet).
Last edited by sigmason on Sat Oct 30, 2010 12:36 am, edited 1 time in total.
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

I suppose I should add that while you can build an OLE DB link to Excel, this would require Excel to be present. Further it's a problem when you're not on Windows if you think about.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by srod »

sigmason wrote:I suppose I should add that while you can build an OLE DB link to Excel, this would require Excel to be present. Further it's a problem when you're not on Windows if you think about.
That is not entirely correct - only the relevant OLE-DB providers need to be installed. You can write to existing xls sheets using ODBC (via the Jet drivers) but of course this is Windows only. I do not know if there are similar ODBC drivers for Linux?
I may look like a mule, but I'm not a complete ass.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by Rook Zimbabwe »

Why don't you create your spreadsheet and your template BEFORE the fact save a copy of them as the new file and use your app to just enter the data in the correct column/cell/page?

Simple no?
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

Rook Zimbabwe wrote:Why don't you create your spreadsheet and your template BEFORE the fact save a copy of them as the new file and use your app to just enter the data in the correct column/cell/page?

Simple no?
That is exactly what I'm trying to do. I suppose it would be easier if I stuck with the XML formats as they basically could be worked with as text files, but I was hoping to support the older formats.
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

srod wrote:
sigmason wrote:I suppose I should add that while you can build an OLE DB link to Excel, this would require Excel to be present. Further it's a problem when you're not on Windows if you think about.
That is not entirely correct - only the relevant OLE-DB providers need to be installed. You can write to existing xls sheets using ODBC (via the Jet drivers) but of course this is Windows only. I do not know if there are similar ODBC drivers for Linux?
There is a package for OLE DB in Linux and even ODBC, but I think it's only databases. It's part of Mono:
http://www.mono-project.com/OLE_DB
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by srod »

OBC on Windows treats an .xls sheet as a database anyhow so there's no distinction to be made on that score.
I may look like a mule, but I'm not a complete ass.
sigmason
User
User
Posts: 37
Joined: Tue Feb 13, 2007 6:24 pm

Re: Wrapper for libxl, Apache POI or OpenOffice?

Post by sigmason »

srod wrote:OBC on Windows treats an .xls sheet as a database anyhow so there's no distinction to be made on that score.
True the usage is similar but if the back end doesn't exist it doesn't help much.

Outside of Mono, it appears unixODBC doesn't itself have an Excel backend (at least not shown in the first few pages of Google).

There is an ODBC/ODBC bridge from EasySoft:
http://www.easysoft.com/products/data_a ... index.html

However, I'm figuring that will require a Windows computer to bridge with, if not at least an instance of wine.
Post Reply