Jump to content
JasperReports Library 7.0 is now available ×

using Parameters


ktrinad

Recommended Posts

By: Tanul Karkare - tanul_karkare

using Parameters

2003-03-21 04:46

Hi,

want to use 2 date values provided by users as start date and end date for my report.

could u please help in using them to generate run time dynamic report based on those 2 date values.

 

regards,

Tanul

http://www.tanul.tk

http://www.geocities.com/ktanul

 

 

 

 

By: Tanul Karkare - tanul_karkare

RE: using Parameters

2003-03-23 21:49

Basically what i want to ask is :

At the time of report generation will it be possible to ask or prompt for a parameter and use it in report.

Right now i am not able to utilize parameters ( $P{anyParam}) as such since i am unable to differentiate them from normal variable ($V{anyVar}).

 

 

 

 

By: Tanul Karkare - tanul_karkare

RE: using Parameters

2003-03-30 22:54

Hi ,

i resolved the earlier problem but continuing it gives me other problem...

I have a Double parameter "coNum" having default value as new Double(1).

I will be changing its value in xml at run time but it should give some result using default value also.

 

i am using following query in Query SQL box of iReport Compiler Tool:

SELECT a.gac_head,a.gopdr, a.gopcr, a.gdr, a.gcr, a.gdesc, a.gconum, c.cconame as cname

FROM

chartacs a, company c

where

a.gconum = $P{coNum}

and

a.gconum = c.cconum

 

Problem is:

instead of replacing $P{coNum} by 1 it displays following error when i use my database connection:-

 

java.sql.SQLException: ERROR: parser: parse error at or near "$" at character 137

 

 

at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)

 

at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)

 

at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)

 

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)

 

at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:153)

 

at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:141)

 

at IReportCompiler.main(IReportCompiler.java:145)

 

 

 

Abnormal termination!

 

what am i doing wrong?

please see if any body could help in some way.

 

thanks & regards

tanul

 

http://www.tanul.tk/

http://www.geocities.com/ktanul

 

 

 

 

 

By: Mark Rhodes - mrhodes2

RE: using Parameters

2003-03-31 09:33

You need to clear the SQL query box when you compile and preview. See other threads in this forum on why.

 

 

 

 

By: Tanul Karkare - tanul_karkare

RE: using Parameters

2003-03-31 20:44

thanks for reply.

I think i got my answer.

 

 

regards,

tanul

 

http://www.tanul.tk/

http://www.geocities.com/ktanul

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