Jump to content
We've recently updated our Privacy Statement, available here ×

ioanbalau

Members
  • Posts

    7
  • Joined

  • Last visited

ioanbalau's Achievements

  1. I do not think this will work. In database i have column UPDATEDTIME. The date and time in this column is from GMT timezone. SQL example: SELECT * FROM table WHERE updatedtime > $P{date}. But $P{date} has this value: 27-11-2017 10:00 (EET time zone) updatedtime column from dbs has this value: 27-11-2017 09:00 but its GMT timezone so the result its not corect. Thank you for answering.
  2. I have one date input parameter used in sql querry. The issue is that the selected date and hours are different from the ones from database. I want to select the date and hour, and in report querry to have the date conversed. Example: If i select as date/time: 27-11-2017 10:00 EET. In sql i need this date/time to be changed to 27-11-2017 08:00 GMT. What options do i have to obtain this?
  3. I found a solution for this. If the Input Parameter is java.util.Date type the hours are not taken into consideration in query(it gets only the date, at least from what i tested). I changed the Input Parameter type to java.sql.Timestamp and now hours are taken into consideration. Thank you!
  4. Why to_char(InputParameter) does not contain hours? Image: https://ibb.co/dMbaRR
  5. So definition of input parameters: Map<String, Object> inputParameters = prepareInputParameters(inputControls); Image before adding the new parameters: Parameter 'DateFromInputControl': https://ibb.co/hezemR Parameter 'DateToInputControl': https://ibb.co/gZMLt6 Function prepareInputParameters() returns a Map<String, Object> type(result): result.put(parameterName, parameterValue); return result; After all the input controls were added: https://ibb.co/gzQ26R
  6. Query in report: select * from table a where b.updatedtime between $P{DateFromInputControl} and $P{DateToInputControl} In Java i used JasperFillManager.fillReport() method. The input controls were formated to java.util.Date format Definition in Jasper report: <parameter name="DateFromInputControl" class="java.util.Date"> <parameterDescription><![CDATA[]]></parameterDescription> </parameter> <parameter name="DateToInputControl" class="java.util.Date"> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter> Link to image(calling in java): https://ibb.co/kkrP36
  7. Hi, In Jasper Studio i have 2 input controls(both java.util.Date). If i try to Preview the report on the same day(Date from: 2017-10-17 02:00 Date To: 2017-10-17 23:00) it works properly. But when i do the same from Java application the hours are not taken into consideration and result into an empty report. If i select the Date From: 2017-10-17 02:00(today) and Date To: 2017-10-18 23:00 it gathers data between 2017-10-17 00:00 to 2017-10-18 00:00. Condition in query: updatedtime between $P{DateFromInputControl} and $P{DateToInputControl} Why hours are not taken into consideration? Thank you, Emi
×
×
  • Create New...