StimVinsh / xdocreport

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

Manage Styled text from Java context with HTML, Wikipedia, Wiki Google syntax #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Today XDocReport manages simple text from the Java context. (ex: $name is 
replaced with a simple text value).

Imagine you have a report with comments section : 

--------------------------------------------------------
$comments 
--------------------------------------------------------

Today you can just replace $comments with simple text (some text).

--------------------------------------------------------
some text
--------------------------------------------------------

It should be cool, to gives the capaibility to style the text (set bold 
charachter with bold style in the report) by using some syntax like HTML, 
Google Wiki, WikiPedia, etc

For instance, set the value some _text_ which uses Google Wiki syntax :

--------------------------------------------------------
some text
--------------------------------------------------------

and text will be bolded.

HTML syntax could be interesting when WEB Application use rich textarea like 
TyniMCE or FCKEditor.

Original issue reported on code.google.com by angelo.z...@gmail.com on 7 Oct 2011 at 12:41

GoogleCodeExporter commented 8 years ago
Test Styling was started to implement for docx (there is a bug with list). 
Please see demo at http://xdocreport.opensagres.cloudbees.net/textStyling.jsp

Original comment by angelo.z...@gmail.com on 12 Oct 2011 at 8:09

GoogleCodeExporter commented 8 years ago
I checked the demo link but I can not find the sample source code for the HTML 
Styling , please could you provide a sample on how to use HTML Styling 

Original comment by osama.ra...@gmail.com on 27 Oct 2011 at 6:41

GoogleCodeExporter commented 8 years ago
Hi, 

Text styling is planned for XDocReport 0.9.3. Today bold and italic works with 
docx with HTML and Wiki syntax. ODT should be implement and we have the 
intention to manage text styling for Hyperlink and bulleted list.

Here teh servlet used in the demo 
http://code.google.com/p/xdocreport/source/browse/demo-webapp/src/main/java/fr/o
pensagres/xdocreport/webapp/TextStylingReportServlet.java?repo=samples

The basic idea is to set a mergefield (see TextSyling.docx from the demo 
http://code.google.com/p/xdocreport/source/browse/?repo=samples#git%2Fdemo-webap
p%2Fsrc%2Fmain%2Fresources%2Ffr%2Fopensagres%2Fxdocreport%2Fwebapp)

-----------------------------------------------------
$comments_html
-----------------------------------------------------

And you must indicate to XDocReport that this field manage HTML text styling 
like this: 

-----------------------------------------------------
FieldsMetadata metadata = new FieldsMetadata();
metadata.addFieldAsTextStyling("comments_html", SyntaxKind.Html);
-----------------------------------------------------

And after you can set HTML text in the context : 

-----------------------------------------------------
context.put("comments_html", "Bold text");
-----------------------------------------------------

Regards Angelo

Original comment by angelo.z...@gmail.com on 27 Oct 2011 at 8:09

GoogleCodeExporter commented 8 years ago
Hi osama,

For your information, XDocReport 0.9.3 will come soon and will provides HTML 
text styling for docx (see explanation at 
http://code.google.com/p/xdocreport/wiki/DocxReportingJavaMainHTMLTextStyling) 
and odt (see explanation at 
http://code.google.com/p/xdocreport/wiki/ODTReportingJavaMainHTMLTextStyling)

This release will manage simple text styling for bold and italic style.

Regards Angelo

Original comment by angelo.z...@gmail.com on 4 Nov 2011 at 10:32

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 19 Jan 2012 at 11:54