Documentation

Trace: Using Raw Values

(applications)

Using Raw Values

This is an old revision of the document!


If you're creating RTF reports with RtfWorker, it's sometimes useful to directly write RTF syntax. This can be useful if you need a feature which it's not already implemented. Such a Raw value can help you in that case.

Here's a short example which creates a simple checkbox with Wingdings font:

Bean bean = new Bean();
bean.put("CHECKBOX", new RawStringValue("{\\field{\\*\\fldinst SYMBOL 254 \\\\f \"Wingdings\" \\\\s 11}{\\fldrslt\\f10\\fs22}}")); 
 
BeanNode node = new BeanNode(bean);
 
RtfWorker w = new RtfWorker();
w.loadDocument(getTemplateInputStream("rawvalues.rtf"));
w.fillInData(node);
w.saveDocument(new FileOutputStream(getTempOutputFile("result_rawvalues.rtf")));

The template only contains:

[CHECKBOX]
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information