简体   繁体   English

将Excel数据加载到Linux / wxWidgets C ++应用程序中?

[英]Load Excel data into Linux / wxWidgets C++ application?

I'm using wxWidgets to write cross-plafrom applications. 我正在使用wxWidgets来编写跨应用程序。 In one of applications I need to be able to load data from Microsoft Excel (.xls) files, but I need this to work on Linux as well, so I assume I cannot use OLE or whatever technology is available on Windows. 在其中一个应用程序中,我需要能够从Microsoft Excel(.xls)文件加载数据,但我也需要在Linux上工作,所以我假设我不能使用OLE或Windows上的任何技术。

I see that there are many open source programs that can read excel files (OpenOffice, KOffice, etc.), so I wonder if there is some library that I could use? 我看到有很多开源程序可以读取excel文件(OpenOffice,KOffice等),所以我想知道是否有一些我可以使用的库?

Excel files it needs to support are very simple, straight tabular data. 它需要支持的Excel文件是非常简单的直表格数据。 I don't need to extract any formatting except column/row position and the data itself. 除了列/行位置和数据本身之外,我不需要提取任何格式。

Suggestedd reference: What is a simple and reliable C library for working with Excel files? 建议参考: 什么是用于处理Excel文件的简单可靠的C库?

I came across other libraries (chicago on sf.net, xlsLib) but they seem to be outdated. 我遇到了其他库(sf.net上的芝加哥,xlsLib),但它们似乎已经过时了。

jrh JRH

也许http://www.libxl.com/可以帮忙吗?

I can say that I know of a wxWidgets application that reads Excel .xls and .xlsx files on any platform. 我可以说我知道一个wxWidgets应用程序在任何平台上读取Excel .xls和.xlsx文件。 For the .xlsx files we used an XML parser and zip stream reader and grab the data we need, pretty easy to get going. 对于.xlsx文件,我们使用XML解析器和zip流读取器并获取我们需要的数据,非常容易上手。 For the .xls files we used: ExcelFormat , which works well and we found the author to be very generous with his support. 对于我们使用的.xls文件: ExcelFormat ,效果很好,我们发现作者对他的支持非常慷慨。

Maybe just some encouragement to give it a go? 也许只是鼓励一下去吧? It was a couple of days work to get working. 上班需要几天时间。

I think that it is not something easy to do. 我认为这不容易做到。 xls files are quite complex and it is a proprietary format. xls文件非常复杂,它是一种专有格式。

Maybe this is a stupid idea but why don't you upload and access your doc with Google docs. 也许这是一个愚蠢的想法,但为什么不上传和访问您的文档与谷歌文档。 There are some apis to access your doc. 有一些api可以访问您的文档。

2 potential problems: - Your app needs internet access - Currently there is no C++ api. 2个潜在问题: - 您的应用需要互联网访问 - 目前没有C ++ API。

But there are api for several languages including python see http://code.google.com/intl/fr/apis/gdata/articles/python_client_lib.html 但有几种语言的api,包括python,请参阅http://code.google.com/intl/fr/apis/gdata/articles/python_client_lib.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM