iReport: Passing parameters from a main report query to a dataset query for a table or list

后端 未结 4 1244
猫巷女王i
猫巷女王i 2020-12-15 05:52

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 th

4条回答
  •  悲哀的现实
    2020-12-15 06:04

    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}

提交回复
热议问题