Results 1 to 5 of 5

Thread: Using QTextDocumentWriter to write a spreadsheet in ODF

  1. #1
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Using QTextDocumentWriter to write a spreadsheet in ODF

    Hi all,

    A program I am writing gets data that need to be written in a spreadsheet. This spreadsheet would be preferably in the ODF-format, so the user can choose multiple programs to view/edit this file.

    The standard extension for the ODF spreadsheet format is ".ods"

    Now, in QT 4.5 there is the QTextDocumentWriter class that can be used to write documents in the ODF document format (".odt").

    So my question is: Can this class also be used to write spreadsheet files instead of text files? Or is there some other qt-class for this that I don't yet know about?

    Thanks in advance!

    DrDonut

  2. #2
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Using QTextDocumentWriter to write a spreadsheet in ODF

    So my question is: Can this class also be used to write spreadsheet files instead of text files? Or is there some other qt-class for this that I don't yet know about?
    No and no.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Using QTextDocumentWriter to write a spreadsheet in ODF

    Quote Originally Posted by DrDonut View Post
    Or is there some other qt-class for this that I don't yet know about?
    Well, the ODF spreadsheet format is simple XML. So you can use QFile, QDomDocument or QXmlStreamWriter to achieve your goal. This, of course, needs that you write the xml yourself, but that's not so a big deal.

  4. #4
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using QTextDocumentWriter to write a spreadsheet in ODF

    Thanks for your reply's

    So I guess I can start reading the ODF-specifcation and write it all like XML-files.

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Using QTextDocumentWriter to write a spreadsheet in ODF

    Quote Originally Posted by DrDonut View Post
    So I guess I can start reading the ODF-specifcation and write it all like XML-files.
    Well, I was too lazy for that, so I create a sample file. Then only grab the content.xml and edited that with my new values. That is easier than creating the whole package from the scratch.

Similar Threads

  1. FSWriteFork in MAC OS to write data to a file.
    By vishal.chauhan in forum General Programming
    Replies: 5
    Last Post: 2nd July 2007, 06:48
  2. who can give me a tutorials of write .pro file
    By fengtian.we in forum Qt Programming
    Replies: 5
    Last Post: 20th May 2007, 16:25
  3. how to write a structure in a shared mem segment.
    By nass in forum General Programming
    Replies: 9
    Last Post: 26th September 2006, 13:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.