Jump to content
Changes to the Jaspersoft community edition download ×

Handling DateTime parameter in JasperStudio to JasperServer


lisa.j.young

Recommended Posts

I have created a report which accepts a java.util.Date as a parameter

In JasperStudio the Date and Time is requested however on JasperServer only the Date is requested and as such the end date is searching until 00:00:00 instead of 23:59:59

I can change the input control on JasperServer to use DateTime, however when I update the report through JasperStudio it overwrites the changes on the Server and goes back to requesting only a Date.

How can I specify in JasperStudio that the parameter should be Date/Time ?

Note: My column in Mysql is of type DateTime, not Timestamp

Excerpt from my jrxml:

<parameter name="startDate" class="java.util.Date"/>
<parameter name="endDate" class="java.util.Date"/>
<queryString language="SQL">
<![CDATA[sELECT someinfo
FROM payments
INNER JOIN paymenttype ON payments.payment_type=paymenttype.id 
WHERE timestamp BETWEEN $P{startDate} and $P{endDate} AND payments.status=1
GROUP BY payments.payment_type, YEAR(payments.`timestamp`), MONTH(payments.`timestamp`)
ORDER BY YEAR(payments.`timestamp`) DESC, MONTH(payments.`timestamp`) DESC]]>
</queryString>

 

Link to comment
Share on other sites

  • 5 months later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...