Issue 220 in xdocreport: Line brake in populateContext

394 views
Skip to first unread message

xdocr...@googlecode.com

unread,
Jan 29, 2013, 2:12:03 AM1/29/13
to xdocr...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 220 by MrSo...@gmail.com: Line brake in populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

What steps will reproduce the problem?
1. Using populateContext to put content in Freemarker fields
2. One field have to be replaced with multiple-line content
3. Replacing "\n" with "<w:br />" and put it with context.put(...)
4. In output docx appears unbreakable newline

What is the expected output? What do you see instead?
I need regular newline instead unbreakable newline

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

Please provide any additional information below.
I did "removeAllPreprocessors()" and add only MacroButtonNamePreprocessor.
In it I remove all "w:fldChar" fields ("begin: and "end" of MACROBUTTON
field) and replace name of "<w:instrText xml:space="preserve">MACROBUTTON
##611043780194## NAME</w:instrText>" with "<w:instrText
xml:space="preserve">{field3}</w:instrText>". I can't change name of this
tag =(
When content stay with "\n" in output there is no line break at all.
Sorry but I didn't understood, what happens after populateContext, what
function working after.

xdocr...@googlecode.com

unread,
Jan 29, 2013, 2:13:46 AM1/29/13
to xdocr...@googlegroups.com

Comment #1 on issue 220 by MrSo...@gmail.com: Line brake in populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

"Line break in populateContext" - can you change name of Issue?

xdocr...@googlecode.com

unread,
Jan 29, 2013, 3:05:28 AM1/29/13
to xdocr...@googlegroups.com
Updates:
Status: Accepted
Owner: angelo.z...@gmail.com

Comment #2 on issue 220 by angelo.z...@gmail.com: Line brake in
populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

If you use mergefield, you don't need to replace yourself in the context \n
with <w:br /> with
http://code.google.com/p/xdocreport/source/browse/document/fr.opensagres.xdocreport.document.docx/src/main/java/fr/opensagres/xdocreport/document/docx/discovery/DocxTemplateEngineConfiguration.java

1) try with \n in your context (and not with <w:br />
2) if it doesn't work, try to replace "\n" with "</w:t><w:br/><w:t
xml:space=\"preserve\">"

If it doesn't work, I don't know, it's because of your custom preprocessor
and I cannot help you more.

xdocr...@googlecode.com

unread,
Feb 5, 2013, 2:19:13 AM2/5/13
to xdocr...@googlegroups.com

Comment #3 on issue 220 by MrSo...@gmail.com: Line brake in populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

Thank you for all of your explanations in all my issues (Issue 210, Issue
211, Issue 212, Issue 215, Issue 219 and Issue 220). I've made my own
preprocessor, which placing needed content on preprocessing stage directly
in docx xml. Can you help me to understand how to use only specific
functions of XDocReport? I need servlet usage, only my preprocessor,
unzipping and zipping docx, using docx xml. I don't need Freemarker and any
other preprocessors but mine.

xdocr...@googlecode.com

unread,
Feb 16, 2013, 11:10:14 AM2/16/13
to xdocr...@googlegroups.com

Comment #4 on issue 220 by angelo.z...@gmail.com: Line brake in
populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

Hi sorry for the delay.

I cannot help you more because you have tweeked a lot of XDocReport. To use
only you rpreprocessors I think you have done already that (clear the
preprocessor and add yours).

For templat engine, XDocReport needs a template engine. So perhaps you
could implements ITemplateEngine which do nothing (never done), but as you
said you you have so modified the initial goal of XDocReport.

Good luck

Regards Angelo

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

xdocr...@googlecode.com

unread,
Feb 18, 2014, 8:48:23 AM2/18/14
to xdocr...@googlegroups.com
Updates:
Status: Invalid

Comment #5 on issue 220 by angelo.z...@gmail.com: Line brake in
populateContext
http://code.google.com/p/xdocreport/issues/detail?id=220

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages