Giter Club home page Giter Club logo

ods2's Introduction

Ods2 - a library to read/write/update OpenDocument Spreadsheet (.ods) files. Supports the most commonly used formula functions (including evaluation).

API usage

See examples/examples[1-2].cc

Also, the file examples/Invoice.ods was generated with Ods2, the source code for the code that generated it is in examples/Invoice.cpp

How to build

See how_to_build.html

License, etc

Library updates might break API compatibility with previous updates to allow for easier development of this library.

Licensed under the GPLv3 or MIT license, see LICENSE for details. For questions, feature requests, etc: f35f22fan AT gmail.com


33 out of 388 functions implemented
Column 1 Column 2 Column 3 Column 4
πŸ”² abs() πŸ”² accrint() πŸ”² accrintm() πŸ”² acos()
πŸ”² acosh() πŸ”² acot() πŸ”² acoth() πŸ”² address()
πŸ”² amordegrc() πŸ”² amorlinc() β˜‘οΈ and() πŸ”² arabic()
πŸ”² areas() πŸ”² asin() πŸ”² asinh() πŸ”² atan()
πŸ”² atan2() πŸ”² atanh() πŸ”² avedev() β˜‘οΈ average()
πŸ”² averagea() πŸ”² averageifs() πŸ”² b() πŸ”² bahttext()
πŸ”² base() πŸ”² besseli() πŸ”² besselj() πŸ”² besselk()
πŸ”² bessely() πŸ”² betadist() πŸ”² betainv() πŸ”² bin2dec()
πŸ”² bin2hex() πŸ”² bin2oct() πŸ”² binomdist() πŸ”² ceiling()
πŸ”² cell() πŸ”² char() πŸ”² chidist() πŸ”² chiinv()
πŸ”² chisqdist() πŸ”² chisqinv() πŸ”² chitest() πŸ”² choose()
πŸ”² clean() πŸ”² code() πŸ”² column() β˜‘οΈ columns()
πŸ”² combin() πŸ”² combina() πŸ”² complex() β˜‘οΈ concatenate()
πŸ”² confidence() πŸ”² convert() πŸ”² convert_add() πŸ”² correl()
πŸ”² cos() πŸ”² cosh() πŸ”² cot() πŸ”² coth()
β˜‘οΈ count() β˜‘οΈ counta() β˜‘οΈ countblank() β˜‘οΈ countif()
πŸ”² countifs() πŸ”² coupdaybs() πŸ”² coupdays() πŸ”² coupdaysnc()
πŸ”² coupncd() πŸ”² coupnum() πŸ”² couppcd() πŸ”² covar()
πŸ”² critbinom() πŸ”² csc() πŸ”² csch() πŸ”² cumipmt()
πŸ”² cumipmt_add() πŸ”² cumprinc() πŸ”² cumprinc_add() πŸ”² current()
β˜‘οΈ date() πŸ”² datevalue() πŸ”² daverage() β˜‘οΈ day()
πŸ”² days() πŸ”² days360() πŸ”² daysinmonth() πŸ”² daysinyear()
πŸ”² db() πŸ”² dcount() πŸ”² dcounta() πŸ”² ddb()
πŸ”² dde() πŸ”² dec2bin() πŸ”² dec2hex() πŸ”² dec2oct()
πŸ”² decimal() πŸ”² degrees() πŸ”² delta() πŸ”² devsq()
πŸ”² dget() πŸ”² disc() πŸ”² dmax() πŸ”² dmin()
πŸ”² dollar() πŸ”² dollarde() πŸ”² dollarfr() πŸ”² dproduct()
πŸ”² dstdev() πŸ”² dstdevp() πŸ”² dsum() πŸ”² duration()
πŸ”² duration_add() πŸ”² dvar() πŸ”² dvarp() πŸ”² eastersunday()
πŸ”² edate() πŸ”² effective() πŸ”² effect_add() πŸ”² eomonth()
πŸ”² erf() πŸ”² erfc() πŸ”² errortype() πŸ”² even()
πŸ”² exact() πŸ”² exp() πŸ”² expondist() πŸ”² fact()
πŸ”² factdouble() β˜‘οΈ false() πŸ”² fdist() πŸ”² find()
πŸ”² finv() πŸ”² fisher() πŸ”² fisherinv() πŸ”² fixed()
πŸ”² floor() πŸ”² forecast() πŸ”² formula() πŸ”² frequency()
πŸ”² ftest() πŸ”² fv() πŸ”² fvschedule() πŸ”² gamma()
πŸ”² gammadist() πŸ”² gammainv() πŸ”² gammaln() πŸ”² gauss()
πŸ”² gcd() πŸ”² gcd_add() πŸ”² geomean() πŸ”² gestep()
πŸ”² growth() πŸ”² harmean() πŸ”² hex2bin() πŸ”² hex2dec()
πŸ”² hex2oct() πŸ”² hlookup() πŸ”² hour() πŸ”² hyperlink()
πŸ”² hypgeomdist() β˜‘οΈ if() πŸ”² imabs() πŸ”² imaginary()
πŸ”² imargument() πŸ”² imconjugate() πŸ”² imcos() πŸ”² imcosh()
πŸ”² imcot() πŸ”² imcsc() πŸ”² imcsch() πŸ”² imdiv()
πŸ”² imexp() πŸ”² imln() πŸ”² imlog10() πŸ”² imlog2()
πŸ”² impower() πŸ”² improduct() πŸ”² imreal() πŸ”² imsec()
πŸ”² imsech() πŸ”² imsin() πŸ”² imsinh() πŸ”² imsqrt()
πŸ”² imsub() πŸ”² imsum() πŸ”² imtan() πŸ”² index()
β˜‘οΈ indirect() πŸ”² info() πŸ”² int() πŸ”² intercept()
πŸ”² intrate() πŸ”² ipmt() πŸ”² irr() πŸ”² isblank()
πŸ”² iserr() πŸ”² iserror() πŸ”² iseven() πŸ”² iseven()
πŸ”² iseven_add() πŸ”² isformula() πŸ”² isleapyear() πŸ”² islogical()
πŸ”² isna() πŸ”² isnontext() πŸ”² isnumber() πŸ”² isodd()
πŸ”² isodd() πŸ”² isodd_add() πŸ”² ispmt() πŸ”² isref()
πŸ”² istext() πŸ”² kurt() πŸ”² large() πŸ”² lcm()
πŸ”² lcm_add() πŸ”² left() πŸ”² len() πŸ”² linest()
πŸ”² ln() πŸ”² log() πŸ”² log10() πŸ”² logest()
πŸ”² loginv() πŸ”² lognormdist() πŸ”² lookup() πŸ”² lower()
πŸ”² match() β˜‘οΈ max() πŸ”² maxa() πŸ”² mdeterm()
πŸ”² mduration() πŸ”² median() πŸ”² mid() β˜‘οΈ min()
πŸ”² mina() πŸ”² minute() πŸ”² minverse() πŸ”² mirr()
πŸ”² mmult() β˜‘οΈ mod() πŸ”² mode() β˜‘οΈ month()
πŸ”² months() πŸ”² mround() πŸ”² multinomial() πŸ”² munit()
πŸ”² n() πŸ”² na() πŸ”² negbinomdist() πŸ”² networkdays()
πŸ”² nominal() πŸ”² nominal_add() πŸ”² normdist() πŸ”² norminv()
πŸ”² normsdist() πŸ”² normsinv() β˜‘οΈ not() β˜‘οΈ now()
πŸ”² nper() πŸ”² npv() πŸ”² oct2bin() πŸ”² oct2dec()
πŸ”² oct2hex() πŸ”² odd() πŸ”² oddfprice() πŸ”² oddfyield()
πŸ”² oddlprice() πŸ”² oddlyield() β˜‘οΈ offset() β˜‘οΈ or()
πŸ”² pearson() πŸ”² percentile() πŸ”² percentrank() πŸ”² permut()
πŸ”² permutationa() πŸ”² phi() πŸ”² pi() πŸ”² pmt()
πŸ”² poisson() β˜‘οΈ power() πŸ”² ppmt() πŸ”² price()
πŸ”² pricedisc() πŸ”² pricemat() πŸ”² prob() β˜‘οΈ product()
πŸ”² proper() πŸ”² pv() πŸ”² quartile() β˜‘οΈ quotient()
πŸ”² radians() πŸ”² rand() πŸ”² randbetween() πŸ”² rank()
πŸ”² rate() πŸ”² received() πŸ”² replace() πŸ”² rept()
πŸ”² right() πŸ”² roman() β˜‘οΈ round() β˜‘οΈ rounddown()
β˜‘οΈ roundup() πŸ”² row() β˜‘οΈ rows() πŸ”² rri()
πŸ”² rsq() πŸ”² search() πŸ”² sec() πŸ”² sech()
πŸ”² second() πŸ”² seriessum() πŸ”² sheet() πŸ”² sheets()
πŸ”² sign() πŸ”² sin() πŸ”² sinh() πŸ”² skew()
πŸ”² sln() πŸ”² slope() πŸ”² small() πŸ”² sqrt()
πŸ”² sqrtpi() πŸ”² standardize() πŸ”² stdev() πŸ”² stdeva()
πŸ”² stdevp() πŸ”² stdevpa() πŸ”² steyx() πŸ”² style()
πŸ”² substitute() πŸ”² subtotal() β˜‘οΈ sum() β˜‘οΈ sumif()
πŸ”² sumifs() πŸ”² sumproduct() πŸ”² sumsq() πŸ”² sumx2my2()
πŸ”² sumx2py2() πŸ”² sumxmy2() πŸ”² syd() πŸ”² t()
πŸ”² tan() πŸ”² tanh() πŸ”² tbilleq() πŸ”² tbillprice()
πŸ”² tbillyield() πŸ”² tdist() πŸ”² text() πŸ”² time()
πŸ”² timevalue() πŸ”² tinv() β˜‘οΈ today() πŸ”² transpose()
πŸ”² trend() πŸ”² trim() πŸ”² trimmean() β˜‘οΈ true()
πŸ”² trunc() πŸ”² ttest() πŸ”² type() πŸ”² upper()
πŸ”² value() πŸ”² var() πŸ”² vara() πŸ”² varp()
πŸ”² varpa() πŸ”² vdb() πŸ”² vlookup() πŸ”² weekday()
πŸ”² weeknum() πŸ”² weeknum_add() πŸ”² weeks() πŸ”² weeksinyear()
πŸ”² weibull() πŸ”² workday() πŸ”² xirr() πŸ”² xnpv()
πŸ”² xor() β˜‘οΈ year() πŸ”² yearfrac() πŸ”² years()
πŸ”² yield() πŸ”² yielddisc() πŸ”² yieldmat() πŸ”² ztest()

ods2's People

Contributors

f35f22fan avatar dantti avatar mirai-computing avatar

Stargazers

datacook avatar AMajor-C avatar Florian Fontan avatar  avatar  avatar avttrue avatar lifof avatar C O M P Ξ Z avatar  avatar Roman Korcakov avatar  avatar  avatar Jim Hurd avatar KTS-Intek avatar  avatar  avatar 马θΏͺ avatar Mikhail Rogachev avatar

Watchers

James Cloos avatar lifof avatar  avatar

ods2's Issues

Fast searching for any cell by content

Is it possible to get cell's position by its contents?
I have an ods which acts as template for a report. It contains cells with MAGIC identifiers. It needs to replace this MAGIC identifiers with actual data.
Iterate over all cells isn't efficiently - because rows and columns count may be variant.

Build fail using Visual Studio 2022 /std::C++20 on Win10

Hello,

I am trying to build Ods2 by Visual Studio 2022 (C++20) on Win10, and I got two build errors:

  1. regarding headers that are related to linux: fatal error C1083: Cannot open include file, No such file or directory
    #include <dirent.h>
    #include <sys/sysmacros.h>
    #include <zstd.h>

  2. fatal error LNK1104: cannot open file '..\lib\Debug\ods.lib'

I need your help please to be able to build your Ods2 lib.

Thank you.
Mahmoud Wali

is kNumberColumnsRepeated / number-columns-repeated used when loading document?

Hi,
I have .ods, it has first 2 cells on the row, which are empty.
If I do row->GetCell(0)->is_empty() I get true, and row->GetCell(0)->ValueToString() returns "" that is correct
but row->GetCell(1)->is_empty() returns false, and row->GetCell(1)->ValueToString() returns value of third cell, same as
row->GetCell(2)->is_empty() returns false, and row->GetCell(2)->ValueToString() returns value of third cell, which is correct

Row in the .ods/content.xml is defined as

 <table:table-row table:style-name="ro1">
               <table:table-cell table:number-columns-repeated="2" />
               <table:table-cell table:style-name="ce4" office:value-type="date" office:date-value="2021-06-02" calcext:value-type="date">
                  <text:p>02.06.2021</text:p>
               </table:table-cell>

Do you use number-columns-repeated property somehow when loading cells? Or just when saving them?

Allow to add text-decoration to number style

Sometimes it's usefull to set a custom text decoration to a number style. I.e. in cases where you want to add an unit to a number.

The resulting number style requires to look like this example:

<number:currency-style style:name="ncs1">
<number:number number:decimal-places="4" number:min-integer-digits="1"/>
<number:text> Unit</number:text>
</number:currency-style>

This could be achieved by adding

inst::NumberText *NumberCurrencyStyle::NewText()
{
	auto *p = new NumberText(this);
	Append(p);
	return p;
}

to NumberCurrencyStyle.cpp

Date-Time can not be read by LibreOffice

Calling cell->SetDateTime(dateTime); causes that in the content.xml an entry is created which can not be read by libreOffice Version: libreoffice-7.3.2.2

The created entry looks like this:
<table:table-cell office:value-type="date-time" office:value="2022-10-31T10:09:41"/>

In order to make it compatible with libreOffice the office:value-type needs to be changed to date without "-time".
Implementing this change keeps it still loading correctly in Microsoft Office.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.