Jump to content
Changes to the Jaspersoft community edition download ×

passing query string as parameter


Recommended Posts

By: elis - pelis

passing query string as parameter

2002-12-11 20:42

Hi,

I've been told that I can pass my query string as a parameter to my report. My select statement is based on user entries in a screen. Many of the entries (about 10) are optional so I want to include them in my select statement only if the user has entered something. That's why I want to check for those entries and build my query string in my application and then pass it to the report (xml).

I tried to create the 'where-clause' in my application and pass it to my report as follows:

in application: String 'where-clause' = "where account = 12345"

and in xml file: <parameter name="where-clause" class="java.lang.String"/>

<queryString>

select

table1.transit TRANSIT,

table1.group GROUP_NAME,

table1.address ADDRESS

 

from table1

$P!{where-clause}

order by table1.transit

<queryString>

Follwoing is the error I get when I compile the report:

I get the error:

dori.jasper.engine.JRException: Errors were

encountered when compiling report design:

statementlist.java:24: ';' expected.

 

private JRFillParameter parameter_where-clause

= null;

 

^

 

1 error

 

 

 

at

dori.jasper.engine.design.JRCompiler.compileRepor

t(JRCompiler.java:82)

 

at

dori.jasper.engine.JasperCompileManager.compileR

eportToFile(JasperCompileManager.java:82)

 

at

dori.jasper.engine.JasperCompileManager.compileR

eportToFile(JasperCompileManager.java:54)

 

at StListReportCompiler.<init>

(StListReportCompiler.java:32)

 

at StListReportCompiler.main

(StListReportCompiler.java:326)

 

I will appreciate your help on this.

 

Thanks,

Elis

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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