MohamedSaeed / xdocreport

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

SyntaxKind.Html not working in nested fields #371

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a docx sample file with mergefields like this
«#foreach($data in $report.chapter31aTp)»
«$data.text»
«#end»

2. add field as HTML syntax
IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in, 
TemplateEngineKind.
context = report.createContext();

FieldsMetadata fieldsMetadata = report.createFieldsMetadata();
fieldsMetadata.addFieldAsTextStyling("$data.text", SyntaxKind.Html);

3. export docx file

What is the expected output? What do you see instead?
When I replace $data.text with "<p>lorem ipsum</p>" I want to see "lorem ipsum" 
with line breaks in Word. Instead I see the string literally.

What version of the product are you using? On what operating system?
1.0.4, Java 1.6, Ubuntu Server 10.10

Original issue reported on code.google.com by steffen....@gmail.com on 25 Feb 2014 at 9:35

GoogleCodeExporter commented 9 years ago
Syntax is without $ : 

------------------------------------------------------------------
fieldsMetadata.addFieldAsTextStyling("data.text", SyntaxKind.Html);
------------------------------------------------------------------

If you have Pojo, you can use annotations 
https://code.google.com/p/xdocreport/wiki/FieldsMetadataTemplate

Original comment by angelo.z...@gmail.com on 25 Feb 2014 at 9:40

GoogleCodeExporter commented 9 years ago
Even without $ it's not working. I do have Pojo, but the annotations also won't 
work for the nested fields.

Original comment by steffen....@gmail.com on 25 Feb 2014 at 10:35

GoogleCodeExporter commented 9 years ago
please attach a simple docx+java main which causes the problem.

Original comment by angelo.z...@gmail.com on 25 Feb 2014 at 10:39