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

Input Control Parameter with SQL value


coderb

Recommended Posts

Hi All,

I'm trying to define an Input control for my report. my report sql includes a parameter like this:

...where tblads.deal_no $P!{mydeal}

I've defined mydeal as a string

when I run this is IReport I enter the Parameter value I enter at run time for mydeal is  :  LIKE 'G%'

this works in Ireport return all rows where deal_no starts with the letter G

Okay, so now I want to run the report on JasperSever, but need to create the Input control to handle this parameter.

I defined the mydeal input control as a Single select List of Values (radio)

The each list itemis

label : G Deals            value:    LIKE 'G%'

label : non G Deals     value:  NOT LIKE 'G%'

Unfortunately this returns an SQL error when run on jasper server, and I though it has something to do with the quotes.

So I tried

value:  "   LIKE 'G%'  "

and value:    LIKE "G%"

and value:    LIKE 'G%'

and other the variations of the above.. but still I get a syntax error. AM LOST.

Can someome please help me?

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

coderb
Wrote:

label : G Deals            value:    LIKE 'G%'

label : non G Deals     value:  NOT LIKE 'G%'

Unfortunately this returns an SQL error when run on jasper server, and I though it has something to do with the quotes.

Which JasperServer version are you using?  I've tried this in JS 3.0 and it worked fine.  Also, what browser are you using?

To debug this a little, could you edit jasperserver/WEB-INF/log4j.properties, and insert a

log4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=debug

line into it?  This would make JasperReports log the query that it executes, so we'll see what value is used for the parameter.

Regards,

Lucian

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