Jump to content
JasperReports Library 7.0 is now available ×

error when using 'where-clause' as parameter


Recommended Posts

By: elis - pelis

error when using 'where-clause' as parameter

2002-12-11 10:06

Hi Wolfgang,

 

First of all thanks for your response. That's exactly

what I want to accomplish, build the where clause

in my parent application.

I am doing that now but I get an error when the

xml report is being compiled.

When this line is executed:

JasperCompileManager.compileReportToFile (

xmlReport );

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 don't know where the ; (semicolon) is missing

from...

 

Following is what I'm doing on my xml file based

on your suggestion. Maybe I'm doing something

wrong here:

 

<parameter name="where-clause"

class="java.lang.String"/>

<queryString>

select

pp.field_2 TRANSIT,

pp.field_3 ACCOUNT,

pp.field_4 CYCLE,

pp.field_20 GROUP_NO,

pp.field_21 GROUP_NAME,

pp.field_25 COURIER,

pp.field_29 FAX,

pp.field_31 FAX_NUMBER

 

from public_properties pp

$P!{where-clause}

order by pp.field_2

<queryString>

 

The 'where-clause' that I build in my application is:

 

String whereClause= "where pp.field_1 = '" +

transit + "' and pp.field_2 = '" + account + "'";

 

'transit' and 'account' hold the values entered from

the user.

 

I'll appreciate it if you can help me solve this

problem.

 

Thanks,

Elis

 

 

 

By: Wolfgang - javabreak

RE: error when using 'where-clause' as parame

2002-12-11 10:24

Hi Elis,

 

try to use where 1=1 in the report query-String and remove the "where"-command in your parameter.

 

By the way. Which version you are using?

 

Jasper try's to generate a prepared-statement, but I don't know if it try this before or after fill in your where-clause.

 

Ciao

Wolfgang

 

 

By: Teodor Danciu - teodord

RE: error when using 'where-clause' as parameter

2002-12-11 23:15

 

Hi,

 

Name your parameter "where_clause" instead

of "where-clause".

The names you supply to parameters, fields,

variables and groups are used to define real Java

variables and the '-' character is not supported

in the Java naming conventions.

 

Thank you,

Teodor

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