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

Problem with Report Book tutorial "Parameter "country" does not exist."


valeskyt

Recommended Posts

I'm using TIBCO Jaspersoft® Studio 6.8.0 - Visual Designer for JasperReports 6.8.0. 

I'm working through this tutorial

https://community.jaspersoft.com/wiki/report-books-jaspersoft-studio

When I enter the query in the section "Creating a Report Part for the Detail Section", it fails with this exception:

net.sf.jasperreports.engine.JRRuntimeException: Parameter "country" does not exist.

The query is: select * from orders where shipcountry = $P{country} order by shipcity

The exception is correct; the tutorial does not define the 'country' parameter until close to the end, but I can't get past this point due to the exception.

So how did the tutorial author get past this point without getting an exception?

Thanks,

Tom

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Tom

You are correct since you are following the instructions verbatim. The sentence "You will create the proper "country" parameter in this report." should be before creating the dataset query otherwise I can't see how you can overcome the error. Apart from that everything else looks pretty detailed and should accomplish the main aim of the article. 

 

 

Link to comment
Share on other sites

Is there a way to create a parameter within the report creation wizard? 
 

What's the standard practice for creating a report that uses parameters in query? Do you just skip the query portion of the wizard, then create the parameters, then do the query in the "dataset and query" tool, then drag all the fields onto the report? 

Or do you just start out with the query without parameters, and add them later once you're done with the wizard and have the initial form created?

Link to comment
Share on other sites

There is no formal standard practice for report development as you can approach it either way as long as you know that by creating a query in a dataset with a parameter, there must exist a parameter defined. If the query is created first with a parameter, it will obviously error with parameter does not exist but the parameter can be created afterwards and then go back to the dataset query to verify it without needing to write the query again. However, if the parameter is included initially you cannot preview the resultset of the query written, so you can write a query that doesn't include any parameters first to preview the result and then include the parameter afterwards..after it being defined and then injected into the SQL.  

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