specifying default date format/ value to Date
Posted on April 18, 2013 at 11:43pm
Hi,
I am new to Jasper Reports, using iReport. Want to know how to specify default value to Date? Also want default date format.
Thanks in advance..
Joined: Apr 18 2013 - 11:40pm
Last seen: 9 years 8 months ago
Posted on April 18, 2013 at 11:49pm
Maybe you should try this, create a style in report and mark it as default, set the property "Pattern" to what you want.
Joined: Nov 26 2012 - 7:34pm
Last seen: 5 years 4 months ago
Posted on April 30, 2013 at 7:29am
Hi
I think you need to find the date format supported by your datasource database.
Example: Oracle: '30-April-2013'
Joined: Aug 29 2012 - 6:13am
Last seen: 6 years 2 months ago
Posted on October 12, 2018 at 3:29pm
I can't find any way to do this directly, but here's a workaround:
1) First make the parameter's type String rather than Date.
2) Then enter a Default value expression for the date literal like this: "2018-01-23"
3) Finally, use something like the following, which might need to get adjusted for the type of SQL you're using:
- For MariaDB (or MySQL) SQL use: STR_TO_DATE($P{From},"%Y-%m-%d"), where you need to first replace 'From' with the name of your actual parameter.
This allows you to easily edit the default value as a string, and then use it as a date type in your SQL.
Joined: May 23 2018 - 10:12pm
Last seen: 4 years 2 months ago