Convert date parameter to simplified format using iReport

I have startDatealso endDateas input parameters. These parameters are used in the request:

SELECT * FROM patientRecords 
WHERE patientRecords.dateOfdischarge BETWEEN $P{startDate} AND $P{endDate} 

Now, since startDateand endDateare the parameters that are passed to JasperReports.

I have to make sure they are in mm/dd/yyyyDate format .

How can I convert an input parameter to this format with iReport?

+3
source share
3 answers

U can try changing patern from propertise> textfield propertise or you can try this to_char (table_name.name, 'mm / dd / yyyy') as the field name

+1
source

, , Mysql

date_column_name date_format ($ P {start_date}, '% Y-% m-% d') date_format ($ P {end_date}, '% Y-% m-% d') date_column_name date_format ($ P {start_date}, '% Y-% m-% d') date_format ($ P {end_date}, '% Y-% m-% d')

0

If I were you, I would directly send these parameters in the same way as in the format you specified in Java. If this is not possible for you and you want to be sure, you can use EL to format, for example, Java or Groovy in iReport

0
source

Source: https://habr.com/ru/post/1778442/


All Articles