Coder Social home page Coder Social logo

odswriter's People

Contributors

kijewski avatar mmulqueen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

odswriter's Issues

Incompatible with jOpenDocument

I encountered an incompatibility with the Java library jOpenDocument. Unfortunately I don't know whether it is odswriter or jopendocument which is misbehaving.

I tried to write an ods file using odswriter:

table = []
row = ["A", "B"]
table.append(row)
out_stream = io.BytesIO()
with odswriter.writer(out_stream) as out:
    out.writerows(table)

Then, I return this in an HTTPResponse to let someone download the ods file.

If this is opened in LibreOffice, everything is fine.

It the jOpenDocument library tries to open the ods file, the following Exception occures:

Exception in thread "Thread-2" java.lang.IllegalStateException: parse error
    at org.jopendocument.dom.ODPackage$1.processEntry(Unknown Source)
    at org.jopendocument.util.ZippedFilesProcessor.process(Unknown Source)
    at org.jopendocument.dom.ODPackage.<init>(Unknown Source)
    at org.jopendocument.dom.ODPackage.<init>(Unknown Source)
    at org.jopendocument.dom.spreadsheet.SpreadSheet.createFromFile(Unknown Source)
...
Caused by: org.jdom.input.JDOMParseException: Error on line 8: Präfix "style" für Attribut "style:name", das mit Elementtyp "number:time-style" verknüpft ist, ist nicht gebunden.
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
    ... 8 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 57; Präfix "style" für Attribut "style:name", das mit Elementtyp "number:time-style" verknüpft ist, ist nicht gebunden.

This happens with jOpenDocument version 1.3 and 1.4 rc2.

error when i have more cells than cols

If I have 4 columns and 2 lines (or 3)
e.g.:
tab = [["col1","col2","col2","col4"],["test1","test2","test3","test4"],["test5","test6","test7","test8"]],
and use function writerows():
writerows(tab)
then you library print error:
"Exception: More cells than cols.". Error in line 113
and I can`t export this to file.

Why wrap the cell references in brackets and place a dot in Formula?

odswriter was not working for me, the Formulas would not be interpreted by Libreoffice 6.4.7.
But removing the code that wraps the cell references in brackets and add a dot before cell references in the Formula class fixed the problem.

        # DO NOT Wrap cell refs in square brackets.
#        s = re.sub(r"([A-Z]+[0-9]+(:[A-Z]+[0-9]+)?)", r"[\1]", s)
        # DO NOT Place a . before cell references, so for example . A2 becomes .A2
#        s = re.sub(r"([A-Z]+[0-9]+)(?!\()", r".\1", s)

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.