Issue 110 in xdocreport: Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in combination with a list

83 views
Skip to first unread message

xdocr...@googlecode.com

unread,
Apr 27, 2012, 11:55:34 AM4/27/12
to xdocr...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 110 by mmus...@gmail.com: Error "$___NoEscape4.TextBody" when
trying to set SyntaxKind.Html in combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Code fragment:

FieldsMetadata metadata = report.createFieldsMetadata();
metadata.addFieldAsTextStyling("person.firstname", SyntaxKind.Html);
metadata.addFieldAsTextStyling("person.lastname", SyntaxKind.Html);

// Person is a bean containing the properties firstname and lastname
List<Person> persons = new ArrayList<Person>();
persons.add(new Person("John", "<b>Smith</b>"));
persons.add(new Person("<i>Amy</i>", "Backer"));
IContext context = report.createContext();
context.put( "persons", persons );

The output is correct if I comment out either the first or the second
method addFieldAsTextStyling(). If both are there, the output in the ODT is
(the formatting of lastname is still right, "Smith" is bold):

$___NoEscape4.TextBody Smith
$___NoEscape4.TextBody Backer

Thanks for your answer.

xdocr...@googlecode.com

unread,
Apr 27, 2012, 12:05:07 PM4/27/12
to xdocr...@googlegroups.com

Comment #1 on issue 110 by mmus...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

It seems the text styling works only for the first field. If I add another
one, the result is:

$___NoEscape0.TextBody $___NoEscape1.TextBody JoSm


xdocr...@googlecode.com

unread,
Apr 27, 2012, 12:33:47 PM4/27/12
to xdocr...@googlegroups.com

Comment #2 on issue 110 by mmus...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

I used Velocity before and it didn't throw any exception. Switch to
Freemarker, here is the stack trace:

fr.opensagres.xdocreport.core.XDocReportException:
freemarker.core.InvalidReferenceException: Expression ___NoEscape3 is
undefined on line 3, column 1
5159 in fr.opensagres.xdocreport.document.odt.ODTReport@1e59128!content.xml.
at
fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine.process(FreemarkerTemplateEngine.java:146)
at
fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine.processWithCache(FreemarkerTemplateEngine.java:92)
at
fr.opensagres.xdocreport.template.AbstractTemplateEngine.process(AbstractTemplateEngine.java:110)
at
fr.opensagres.xdocreport.template.AbstractTemplateEngine.process(AbstractTemplateEngine.java:82)
at
fr.opensagres.xdocreport.document.AbstractXDocReport.processTemplateEngine(AbstractXDocReport.java:748)
at
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.java:500)
at
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.java:466)
at
ch.intertec.storybook.test.export.TestXdocreport.main(TestXdocreport.java:79)
Caused by: freemarker.core.InvalidReferenceException: Expression
___NoEscape3 is undefined on line 3, column 15159 in
fr.opensagres.xdocreport.documen
t.odt.ODTReport@1e59128!content.xml.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.NoEscapeBlock.accept(NoEscapeBlock.java:70)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:428)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at
fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine.process(FreemarkerTemplateEngine.java:142)
... 7 more


xdocr...@googlecode.com

unread,
May 4, 2012, 9:38:04 AM5/4/12
to xdocr...@googlegroups.com
Updates:
Status: Accepted
Cc: angelo.z...@gmail.com

Comment #3 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Hi,

Coudl you attach your docx or odt, java sampel please.

Thank a lot.

Regards Angelo

xdocr...@googlecode.com

unread,
May 4, 2012, 10:20:47 AM5/4/12
to xdocr...@googlegroups.com

Comment #4 on issue 110 by mmus...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

The files are attached. Basically I merge the list and text styling sample.
Thanks,
- Martin

Attachments:
ODTTextStylingWithFreemarker.odt 9.5 KB
Person.java 1.4 KB
XdocreportTest01.java 3.0 KB

xdocr...@googlecode.com

unread,
May 4, 2012, 3:08:49 PM5/4/12
to xdocr...@googlegroups.com

Comment #5 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Hi,

Many thanks for your files.
For the moment, I have no time to study your case. I will do that as soon
as possible.

Regards Angelo

xdocr...@googlecode.com

unread,
Jun 22, 2012, 6:09:54 AM6/22/12
to xdocr...@googlegroups.com

Comment #6 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Hi Martin,

I tell me which version of XDocReport do you use? I have tested your sample
and it works great the future version of XDocReport 0.9.8. I think it
should work with 0.9.7 (I have do nothining for manage your case since
0.9.7).

If you are using 0.9.7, could you test with 0.9.8 (with Git or use 0.9.8
SNAPSHOT).

Many thank's.

Regards Angelo

xdocr...@googlecode.com

unread,
Jun 22, 2012, 8:53:08 AM6/22/12
to xdocr...@googlegroups.com

Comment #7 on issue 110 by mmus...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Thanks, yes, I've used 0.9.7. You can close this issue. We are using
another framework now.

xdocr...@googlecode.com

unread,
Jun 22, 2012, 9:06:51 AM6/22/12
to xdocr...@googlegroups.com

Comment #8 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Hi Martin,

That's really shame for us-(
I'm sorry that you are disapointed with XDocReport. Could you tell me which
framework do you use now and why you wish use it instead of XDocReport.

xdocr...@googlecode.com

unread,
Jun 22, 2012, 9:23:35 AM6/22/12
to xdocr...@googlegroups.com

Comment #9 on issue 110 by mmus...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Nothing to be ashamed of. A simple HTML export was enough for our purpose -
at least so far. We'll probably come back to your framework for a later
version of our software.

xdocr...@googlecode.com

unread,
Jun 22, 2012, 9:43:58 AM6/22/12
to xdocr...@googlegroups.com
Updates:
Status: Invalid

Comment #10 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

OK thank's for your reply.
I close this issue.

Regards Angelo

xdocr...@googlecode.com

unread,
Jul 25, 2012, 6:19:50 AM7/25/12
to xdocr...@googlegroups.com

Comment #11 on issue 110 by maure...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Please reopen it.

Works with list, but not inside a table

I'm using Freemarker and xdocreport 0.9.8

Thanks


Attachments:
ODTTextStylingWithFreemarker (1).odt 9.8 KB

xdocr...@googlecode.com

unread,
Jul 25, 2012, 8:57:49 AM7/25/12
to xdocr...@googlegroups.com

Comment #12 on issue 110 by angelo.z...@gmail.com:
Error "$___NoEscape4.TextBody" when trying to set SyntaxKind.Html in
combination with a list
http://code.google.com/p/xdocreport/issues/detail?id=110

Hi,

What is your problem? (throw an error? text styling is not applied?)
I have testes and it works great for me.

Could you attach your Java code please (Main+Pojo).

Many thank's

Regards Angelo

Reply all
Reply to author
Forward
0 new messages