Print custom text in a report using DynamicJasper

1.7k views Asked by At

is it possible to print some custom text after the title (and subtitle) using DynamicJasper? The use case is that I want to print a table report where the data is filtered by some criteria, and I need to output the criteria as well. For example, a report of 26-year-old people living in Stockholm would look like this:

TITLE
Subtitle

Age: 26
City: Stockholm

| Name     | Age | Street | City      |
-----------------------------------
| John Doe | 26  | ...    | Stockholm |

An another example might be this invoice which is printed using DynamicReports. If it's not possible I would probably migrate to DynamicReports.

Thanks!

2

There are 2 answers

0
janhink On BEST ANSWER

Since I did not find any solution to my answer using DynamicJasper I have migrated to DynamicReports which is able to do what I intended.

0
Assy On

DynamicJasper AutoText might be helpful..

Check http://dynamicjasper.com/2010/10/06/how-to-create-autotext-ie-page-xy-out-of-the-box/

AutoText age = new AutoText(("Age :" +26),
AutoText.POSITION_HEADER,
HorizontalBandAlignment.LEFT);
age.setWidth(new Integer(500));
drb.addAutoText(age);

drb comes as reference of DynamicReportBuilder