StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Interrmittent corrupt file #94

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Checking an object exists as well as one of it's fields
2.
3.

What is the expected output? What do you see instead?
Expected output is two rows between name and date of birth (house and town) 
with their values in the next cell. Actual output is a corrupt docx file. The 
error produced when opening the file is (The name in the end tag of the element 
must match the element in type in the start tag - line 2, col 5766). 

What version of the product are you using? On what operating system?
0.9.6 - Windows 7

Please provide any additional information below.
This is a very bizarre bug to replicate and happens intermittently. Having 
looked at the document.xml file of the output, it appears as though some 
@before-row's have not been removed correctly. If I were to open the template, 
save it and the program again, the output file will open without problems.

Original issue reported on code.google.com by xnix...@gmail.com on 20 Mar 2012 at 3:53

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

I will see this bug as soon as I will have time.

Regards Angelo

Original comment by angelo.z...@gmail.com on 20 Mar 2012 at 4:38

GoogleCodeExporter commented 8 years ago
Ok I have seen your docment.xml, and I suppose that the problem is 
"w:instrText" which is splitted :

----------------------------------------------------------------------------
<w:r>
  <w:instrText xml:space="preserve"> MERGEFIELD  "@before-row[#if address?? && address.street??]"  \</w:instrText>
</w:r>
<w:r>
  <w:instrText xml:space="preserve">* MERGEFORMAT </w:instrText>
</w:r>
----------------------------------------------------------------------------

It's not a easy task because today XDOcReport works just with no splitted 
w:instrText. I must study how to manage that.

Regards Angelo

Original comment by angelo.z...@gmail.com on 20 Mar 2012 at 8:28

GoogleCodeExporter commented 8 years ago
Hi,

I have fixed the problem and commited my work on Git. I can generate a well 
docx with your sample. I have added a JUnit with your case at 
http://code.google.com/p/xdocreport/source/browse/integrationtests/fr.opensagres
.xdocreport.core.test/src/test/java/fr/opensagres/xdocreport/document/docx/prepr
ocessor/DocxPreprocessorStartStopRowTestCase.java ( see test 
test2InstrTextStartTopRow).

Regards Angelo

Original comment by angelo.z...@gmail.com on 21 Mar 2012 at 2:37

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 27 Mar 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Many thanks. I also noticed this happening the other day where it was chopping 
a #list statement in half and therefore causing errors in freemarker.

Original comment by xnix...@gmail.com on 28 Mar 2012 at 7:24