Jump to content

Recommended Posts

Posted

By: Alexandru Cârstoiu - acarstoiu

computed query string - impossible?

2004-07-29 06:14

Hello.

 

I know it's not really iReport's problem, but maybe you have an idea.

 

The problem is simple. $V{...} is NOT accepted by the JasperReports engine in the report query string. So how can I compute (parts of) the query string, based on the parameters received?

 

To be more specific, I have to perform a search and replace on the parameter of a report before actually using its value in the query. And I can't do it before running the report.

 

Thanks,

alexandru

 

 

 

 

 

 

By: Rick Millar - rmillar

RE: computed query string - impossible?

2004-07-29 13:21

Caveat: I don't really know what I'm talking about....

 

You may want to try defining a parameter $P{...} whose default value expression is $V{...} then reference that parameter in your query. In your reference to the parameter in your query you may need to include an exclamation point (e.g. where blah = $P!{...}).

 

I don't know if this will solve the timing issue of when the parameter expression is evaluated during report execution though.....

 

Rick

 

 

 

 

By: Alexandru Cârstoiu - acarstoiu

RE: computed query string - impossible?

2004-07-30 05:30

I discovered that if you declare a (not for promting) parameter with a default value that is an expression depending on previously declared parameters, IT WORKS!

 

So I can actually compute parameters, which can be used in the query.

alexandru

 

PS: another solution which I have thought of yesterday would have been to move everything in a subreport and to send it computed parameters.

 

 

 

 

By: Alexandru Cârstoiu - acarstoiu

RE: computed query string - impossible?

2004-07-30 06:38

One more thing. I had to use a text editor for doing the trick described above. If I try to use iReport and insert a computed parameter in the query, I am greeted with a beanshell error.

 

To whom it might concern.

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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