Pentaho Report Designer shows Year as comma separated value

651 Views Asked by At

I am using Pentaho Report Designer to show user logs. I created a data connection in MySQL :

MySQL field name: activity_date 
MySQL field type: timestamp 
value: 2013-01-01 00:00:00

Query: "SELECT YEAR(activity_date) AS year....."

gives me an output of 2013.

But in the report template it shows 2,013. So I tried to change my SQL query to

SELECT CAST(YEAR(activity_date ) AS CHAR) AS year

but on changing this, Report Designer shows empty value in that column.

2

There are 2 best solutions below

2
On

Click on the field in the report designer and check its format in the attributes tab (usually on the bottom right side). Just use # if you don't need a comma.

0
On

I had the same problem. I solved the problem by creating the report again, by using the Report Design Wizard.
In the last step of the wizard (which is called Format step), fill the Data format input with the string #.