Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6679815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:24:09+00:00 2026-05-26T04:24:09+00:00

We insert data from a database into a word-document (Word 2007). There are tables

  • 0

We insert data from a database into a word-document (Word 2007). There are tables in it, and every set of data should be on a seperate page.
Right now PHPWord covers our needs pretty good. But some of our customers use OpenOffice.org, and PHPWord doesnt seem to create a 100% correct Word-Document. Word can handle that errors, but OpenOffice cant.

So, my question is: Is there any other good PHP-library that creates documents both Editors can read, or is it better use a library for Word and another one for OpenOffice.org? (For OpenOffice.org I would use http://www.odtphp.com/). I would prefer to use a single library which creates a Word document.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:24:10+00:00Added an answer on May 26, 2026 at 4:24 am

    Okay, we found the solution. I’ll write it in here just in case somebody has the same problem.
    The files were missformated in OpenOffice.org because PhpWord formats the xml with spaces and newlines. Word removes this lines and shows the document how its supposed to be, but OOo inserts a newline for every newline in the xml-doc in the document is shows. Changing the lines 79 and 84 inside Shared/XMLWriter.php did the trick.

    // Set default values
    // proposed to be false in production version
    $this->_xmlWriter->setIndent(true);
    //$this->_xmlWriter->setIndent(false); 
    
    // Set indent
    // proposed to be '' in production version
    $this->_xmlWriter->setIndentString('  ');
    //$this->_xmlWriter->setIndentString('');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

now i need to insert some data from the sqlserver into a word,i know
Should I use textbox.text.Trim() function every time when I insert any data from web
So, I'm importing data from one database into another. There are about 5,000 records
I insert data from a typed dataset into my MSSQL database by using SqlBuldCopy
i retrieve data from upc database and then want to insert the data into
I am creating windows application to insert data from Excel file into database. My
The data I am trying to insert is from a database, and while inserting
I need to insert data from table1 into table2. However, I would like to
I have to read data from some files and insert the data into different
I need to copy data from one database into my own database, because i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.