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

Adding a DataType


kc5qoc

Recommended Posts

I would like to add the datatype java.sql.Timestamp to the list of available datatypes available for input controls. I need this in order for my reports to function within JasperServer 1.2.1

 

I understand that there are Date and DateTime datatypes and have used them in the past. The problem is that Oracle needs the java.sql.Timestamp. When I define a parameter using this type and publish the report in JasperServer with an input control of type Date or DateTime I get an error from JasperServer saying the data submitted is type java.util.Date which is NOT java.sql.Timestamp. (It works fine in iReport because it understands java.sql.Timestamp)

 

Is there a process defined to add a datatype to the repository so that is becomes available to the input controls ?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 month later...

I have a workaround for this. I've added a prompting parameter accepting java.util.Date (let's call it paramDate), and then I have a second non-prompting parameter of java.sql.Timestamp (let's call it paramTS). paramTS has as its default expression:

 

new java.sql.Timestamp($P{paramDate}.getTime())

 

The paramTS is the one used I plug in to the query.

 

I'm using Postgres with timestamp fields and so I needed to get a prompted date from the user into the query and this works fine for me.

 

Hope this helps your situation.

Link to comment
Share on other sites

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...