dogfuel Posted October 29, 2007 Share Posted October 29, 2007 What is the best practice for dealing with the 'feature' that returns dates from the Calendar Java-style (and, if it is intentonal, why does iReport handle it differently than JasperServer)? I assume handling this in SQL as some suggested is really bad for performance. Do I set a default parameter value that converts? Can/do I create a variable that converts the prompt value and se the variable in the report (and are things calculated in a sequence that allows this)? Is there a step by step guide to dealing with this (for dummies. like me)? Thanks Link to comment Share on other sites More sharing options...
lucianc Posted October 29, 2007 Share Posted October 29, 2007 Which feature is that? And what and how does iReport handle differently? And what's wrong in JasperServer? Regards,Lucian Link to comment Share on other sites More sharing options...
dogfuel Posted October 30, 2007 Author Share Posted October 30, 2007 nothing is wrong in JasperServer - didn't mean to sound critical. The Calendar control in JasperServer returns a date in a java format that MySQL cannot use without reformatting - iReport's calendar prompt returns a date that does work with MySQL. The question can be rephrased as "what is the cleanest way to use a JS 2.01 Calendar control as a prompt for a report on a MySQL source?" thanks Link to comment Share on other sites More sharing options...
lucianc Posted October 30, 2007 Share Posted October 30, 2007 The cleanest way would be to only use date values (and never explicitely format/parse dates to String) by create a java.util.Date parameter in the report, using it in the query via a $P{..} placeholder, and defining a date input control for it in JasperServer. The JRXML would contain something likeCode:<!-- JRXML --><parameter name="DateParam" class="java.util.Date" isForPrompting="true"/><queryString>SELECT ... WHERE date_column = $P{DateParam}</queryString> If this doesn't work in JasperServer, it's a bug. In this case, please provide enough information so that we'd be able to replicate it. Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now