HTML Text Styling does not working

299 views
Skip to first unread message

Frederic le hannier

unread,
Dec 30, 2016, 5:05:25 PM12/30/16
to xdocreport
Hi guy, 
thx for your librarie.

In need to make style in my document docx. i've following this tutorial https://github.com/opensagres/xdocreport/wiki/DocxReportingJavaMainHTMLTextStyling but when the docx is generated, the content is not interpreted :

<i>Text</i> coming from <b>Java context</b>. for $comments.

It's a basic example really and i don't no why the html is not interpreted.

My second question is, do you know if we can make shape on a document by using css or docx tag like <a:graphic>.....</a:graphic> ?

Thanks for your answer,

king regards

Angelo zerr

unread,
Dec 31, 2016, 9:35:41 AM12/31/16
to xdocr...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "xdocreport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frederic le hannier

unread,
Jan 4, 2017, 9:45:14 AM1/4/17
to xdocr...@googlegroups.com
Hi, i pick up the sample but maven doesn't want to build because it can't get jar from repo. have you got the repos ?

tks
Message has been deleted
Message has been deleted

Frederic le hannier

unread,
Jan 5, 2017, 4:17:20 AM1/5/17
to xdocreport
Hi,

My example  :

My docx :

$HTML

Java side

IXDocReport report = createReport(inputStream);

FieldsMetadata metadata = report.createFieldsMetadata();


metadata.addFieldAsTextStyling(champ, SyntaxKind.Html, true );

context.put("HTML", "<i>Text</i> coming from <b>Java context</b>.");

report.process(context, outputFIle);


The result docx:

<i>Text</i> coming from <b>Java context</b>.


What's wrong ?

To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+...@googlegroups.com.

Angelo zerr

unread,
Jan 5, 2017, 4:20:42 AM1/5/17
to xdocr...@googlegroups.com
Do you use mergefield inside your docx for $HTML?

Otherwise please share your docx.

To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+unsubscribe@googlegroups.com.

Frederic le hannier

unread,
Jan 5, 2017, 4:39:59 AM1/5/17
to xdocreport
Metadata description: 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fields templateEngineKind="Velocity" >
<description><![CDATA[]]></description>
<field name="HTML" list="false" imageName="" syntaxKind="Html">
<description><![CDATA[]]></description>
</field>
</fields>

Le samedi 31 décembre 2016 15:35:41 UTC+1, Angelo a écrit :
To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+...@googlegroups.com.
Message has been deleted

Angelo zerr

unread,
Jan 5, 2017, 4:43:17 AM1/5/17
to xdocr...@googlegroups.com
I mean your docx not your XML filed medata. You must use MS Word mergefield to declare $HTML and not write directly $HTML in your docx.

2017-01-05 10:40 GMT+01:00 Frederic le hannier <fleha...@gmail.com>:
I post the met
To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+unsubscribe@googlegroups.com.

Frederic le hannier

unread,
Jan 5, 2017, 4:48:12 AM1/5/17
to xdocreport
wonderful you right, thanks you very much. my mistake was to weite juste $HTML in the document. width the mergefield it's better.

Thanks you !!

Frederic le hannier

unread,
Jan 5, 2017, 4:53:25 AM1/5/17
to xdocreport
To have color with HTML is it possible or not ?

Angelo zerr

unread,
Jan 5, 2017, 4:56:05 AM1/5/17
to xdocr...@googlegroups.com
To have color with HTML is it possible or not ?


To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+unsubscribe@googlegroups.com.

Frederic le hannier

unread,
Jan 5, 2017, 5:41:25 AM1/5/17
to xdocreport
Do you think it's possible to mix width Apache poi to get color ?

Angelo zerr

unread,
Jan 5, 2017, 5:46:55 AM1/5/17
to xdocr...@googlegroups.com
Do you think it's possible to mix width Apache poi to get color ?

No, XDocReport docx support should interpret HTML color to generate docx color. But no time to do that.

To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages