views:

464

answers:

1

I understand how to pass parameters from a main report to a subreport, since there's a specific field for this in the subreport object. However, I'd like to do the same thing with a table or list object as a consumer (rather than a subreport). Is it possible?

For example, say I have a parameter of 'customerID' that I can populate with a main report query, but I can't seem to pass this parameter to the table's dataset's SQL query.

I've tried, and continue to try, various combinations of parameters, fields, and variables, but to no avail.

Does this sort of thing require a subreport implementation?

(If it matters and isn't obvious, I'm using JDBC)

A: 

Hi,

I make a quick test report to replicate what you were doing and it worked.

Here are the steps I took.

  • Create a parameter in your report e.g. customerID

  • Pass it to your main report in a hashmap.

    hashmap.put("customerID", "12345");

  • In the report set the property The language of for the dataset query to SQL.

  • Set the property Query text to something similar as is bellow.

    select * from * customers c where c.ID=$P{customerID}

Gordon