I created the word file using spire.doc, and it works fine.
I my working solution, the customer will download the file created and open by WPS or word.
So many people use WPS in China, and I can't change their behavior obviously.
The problem is, the WPS can't read the "word file" created by spire.doc correctly, if the file contains tables. So the customer will think the "word file is wrong". WPS could open the file, but the tables in it has big problem:
1) some cells is not in the right place.
Chose these cells, right-click it, and chose "table property", you will see their HorizontalAlignment was set to Right, and their WrapTextAround was set to True, that makes the wrong position. If I change them to Left and False, the cells will be back to their right place.
In the c# code which created the file, I set them to Left and False like this:
- Code: Select all
row = table.AddRow()
row.RowFormat.HorizontalAlignment = RowAlignment.Left
row.RowFormat.WrapTextAround = False
If you open the file in the "MS-word", you will see they are Left and False,and the cells position is OK.
2) some cells are missing
You will see from the second row, some cells in the cecond columns are missing.
You can down load the result doc file(problem file) here:http://test.kpichina.com.cn/result file(problem file).doc
You can down load the template file here: http://test.kpichina.com.cn/template file.doc
I used in the thread attachment( in c#, I open the template file, and insert table rows, and save to the result doc file with another name).
When you see above, you maybe say, That's the problem of WPS?
But I found if I open the file by "MS word" and save it again(don't change anything, just oepn and save), then the WPS will read the file correctly! The word file created by Spire.Doc is NOT an REAL MS Word File? There must be something different, that make the problem. so that's why I post the problem here, and think we could found what's the diffrent place between the file created by Spire.Doc and the file overwhited by Ms-Word(open and save).
WPS is a popular word file tool in China. If the word file created by Spire.Doc can't be read by WPS, that will make tens of thousands of customers in China can't use Spire.Doc.
Please help me!
yours,
Ivan