To be short I would like to describe the possible design during which implementation you can encounter the behavior that may require usage of the property that I will share with you.
Scenario:
The data in the Data Source that is expected bo be used in the report has the column with the type of Date in the databse
The report should be translated to different languages, and as we know each langage has its own representatiion(or pattern) according to which a field with the type of Date should be represented
To apply the dynamic formatting to the column with type of Date we can use Expression that I quote below:
DateFormat.getDateInstance(DateFormat.SHORT,$P{REPORT_LOCALE}).format($F{customer_birthdate})
This expression will help you to represent the column with type of Date with regards of Locale that is used during log in operation.
However, if you try to activave JIVE sorting/filtering feature by clicking on the table header, you will find that soring/filtering buttons are inactive.
Below I give you the explanation regarding this behavior that I've got from our engineering team and the possible workarounds:
"It's not exactly a bug.
The columns in the table that are neither sortable nor filterable contain complex formulas in their detail text field expressions. JIVE looks at the expression in the detail text field to understand what is the data source field or variable it needs to sort and filter after. When the text field uses a simple expression with only the name of a field or variable, things work smooth.
Another approach is to [...] specify at column level in the table component, which is the field or variable to use for sorting and filtering, using one of the following two custom properties that can be set in the column tag/object:net.sf.jasperreports.components.table.column.field net.sf.jasperreports.components.table.column.variable...
In this case, setting the net.sf.jasperreports.components.table.column.field property to customer_birthdate at the column level should do."
I have attached a sample of the report that I used in this article (Foodmart Database/PostgreSQL).
Best regards,
Alex
Recommended Comments
There are no comments to display.