Trace:
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
applications:calculdated_value [2020/02/05 13:32] admin created |
applications:calculdated_value [2020/06/15 10:27] (current) cduncan |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ~~NOTRANS~~ | ||
| + | ~~Title: Using Calculated Values~~ | ||
| + | Sometimes, it's useful to add calculated values to your report. To do this, simply use your own implementation of **ICalculatedValue**. | ||
| + | |||
| + | Here's an example: | ||
| + | |||
| <code java> | <code java> | ||
| Bean bean = new Bean(); | Bean bean = new Bean(); | ||
| Line 18: | Line 24: | ||
| w.fillInData(node); | w.fillInData(node); | ||
| w.saveDocument(new FileOutputStream(getTempOutputFile("result_calculatedValues.rtf"))); | w.saveDocument(new FileOutputStream(getTempOutputFile("result_calculatedValues.rtf"))); | ||
| + | </code> | ||
| + | |||
| + | If you're using an AbstractDataNode like **StorageNode**, **ListNode** or **EmptyNode**, be sure that you set the calculated value as parameter: | ||
| + | |||
| + | <code java> | ||
| + | dataNode.setParameter("CALCULATED", new ICalculatedValue() {...}); | ||
| </code> | </code> | ||
