Jump to content

Report will Not Read Parameters


SDyke

Recommended Posts

I am calling JasperReport from a servlet. I am sending two strings as parameters. The report fails and returns this message:

 

SystemOut O 5/1/2008

SystemOut O 5/5/2008

 

SystemOut O net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query :

 

Select ftdatem, task, webprddt6.resmngt3.projindex, jobno, assigned, hours2, remhours From webprddt6.resmngt3 Join webprddt6.resmngt2 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq Where deptno = ? And ftdatem >= ? And ftdatem < ? Group By ftdatem, task, webprddt6.resmngt3.projindex, jobno, assigned, hours2, remhours Order By ftdatem

 

This is my Select string:

 

Select ftdatem, task, webprddt6.resmngt3.projindex, jobno, assigned, hours2, remhours From webprddt6.resmngt3 Join webprddt6.resmngt2 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq Where deptno = $P{deptno} And ftdatem >= $P{sd1} And ftdatem < $P{fd1} Group By ftdatem, task, webprddt6.resmngt3.projindex, jobno, assigned, hours2, remhours Order By ftdatem

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Yes. I am sending three prams to the report.

 

 

 

I have tested this every way I know how and no success. I changed the two parameters(sd1 and fd1) in the SQL statement to hard coded strings and ran the report with two fields to display the two parameters I am sending and it looks like the values are getting to the report okay. However, tt looks like the SQL statement doesen't interpret the parameters(sd1 and fd1) correctly. Thanks for helping me figure this out.

Link to comment
Share on other sites

Hi --

 

Try $P!{fd1} and $P!{sd1} and $P!{deptno}

 

I'm not sure if that will solve your problem entirely. Are the fd1 and sd1 date strings with some kind of format? If they are strings, and your SQL will understand the query with the strings you give it, I think you may need single quotes around the $P!{fd1} and $P!{sd1}. I'm not entirely if single quotes are needed, but I always surround my string params with single quotes.

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