karurkarthi / xdocreport

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

Ability to save preprocessed archive #272

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I see org.apache.velocity.exception.ParseErrorException: Encountered "<EOF>" 
at 
fr.opensagres.xdocreport.document.docx.DocxReport@63beba07!word/document.xml[lin
e 1, column 170413]
2. I want to check what's in column 170413
3. But the original word/document.xml and the preprocessed word/documnet.xml 
are different

What is the expected output? What do you see instead?
I would like to know if it's possible to save the preprocessed archive before 
it is passed to templating engine so that I can inspect errors.

What version of the product are you using? On what operating system?

Please provide any additional information below.
I use version 1.0.0 of xdocreport (velocity and document.docx) on Windows 8 
with Java 1.7.

Original issue reported on code.google.com by wiktor.k...@gmail.com on 3 Jun 2013 at 10:24

GoogleCodeExporter commented 9 years ago
For your information, last version is 1.0.2.

IXDocReport#getDocumentArchive() should help you.

Regards Angelo

Original comment by angelo.z...@gmail.com on 3 Jun 2013 at 11:32

GoogleCodeExporter commented 9 years ago
Excellent!

For the reference the call looks like this:

XDocArchive.writeZip(report.getPreprocessedDocumentArchive(), outputStream);

Thanks Angelo for this outstanding library. I've tested many Word-report 
libraries but this one looks and works just as I would expect - a library that 
can be used in production and has a very intuitive API. Have a nice day!

Original comment by wiktor.k...@gmail.com on 3 Jun 2013 at 12:09

GoogleCodeExporter commented 9 years ago
Hi wiktor,

we are gladXDocReport please you. Don't hesitate to create issues with some 
suggestions to improve XDocReport.

Perhaps errors management should be improved? For your info, if you configure 
logs https://code.google.com/p/xdocreport/wiki/ConfigureLogging you must see 
XML entries preprocessed in the log.

Regards Angelo

Original comment by angelo.z...@gmail.com on 3 Jun 2013 at 12:13

GoogleCodeExporter commented 9 years ago
Wow, thanks! That will be helpful as I had issues with Velocity preprocessor 
that caused parseerror when using #foreach(...) instead of #{foreach}(...). I 
wanted to see what exactly does the Velocity engine see and the logging and 
getPreprocessedDocumentArchive may help greatly. (Unfortunately I can't share 
the template).

Errors, if they appear, generally come from external libraries (like Velocity). 
Ideally I'd like to see the context where you have starting tag that doesn't 
have corresponding #end. But this is not a direct issue for xdocreport but 
instead for Velocity. And Velocity was created to preprocess simple text files 
(like HTML) and not complex XML blobs like OpenXML. Well, that's different 
thing but maybe one day I will see if I can plug my own simple templating 
engine.

Original comment by wiktor.k...@gmail.com on 3 Jun 2013 at 1:34

GoogleCodeExporter commented 9 years ago
Ok thank"s for your info.

I close this issue.

Original comment by angelo.z...@gmail.com on 3 Jun 2013 at 9:09