Closed GoogleCodeExporter closed 9 years ago
Your case is when you type $ in the docx. I think that should be forbidden
because $ crashes the Velocity. If you have some idea to resolve that, don't
hesitate.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 13 Mar 2012 at 12:52
The $ happen to be a dollar sign for cash amount, which unfortunately is going
to occur in many documents. I thought XDocReport only supposed to parse
stuff
that is a MergeField ? If the $ sign is not in the Merge field, is it possible
to replace
it with some other encoding(or put a empty space behind it), to escape the $
sign ?
I guess this is also a velocity issue, in that it should not recognize "$___"
as a special
tokens, and should just ignore it as plain strings.
Thanks.
Original comment by mingkem...@yahoo.com
on 13 Mar 2012 at 3:15
Hi,
I understand your need, so I have implemented your idea with Freemarker and
Velocity for docx+odt where template engine is evaluated only for mergefield
(for Velocity, #[[ ]]# is used and for Freemarker [#noparse][/#noparse]).
By default, the whole XML entry (ex: word/document.xml for Docx, content.xml
for ODT, etc) is evaluated by the template engine. If you wish evaluate only
directive coming from mergefield, you must customize FieldsMetadata like this :
------------------------------------------------------------------
FieldsMetadata metadata = report.createFieldsMetadata();
metadata.setEvaluateEngineOnlyForFields( true );
------------------------------------------------------------------
I have tested with your docx and it works. This feature is commited on Git.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 13 Mar 2012 at 2:40
Original comment by angelo.z...@gmail.com
on 27 Mar 2012 at 9:40
Original issue reported on code.google.com by
mingkem...@yahoo.com
on 13 Mar 2012 at 12:05Attachments: