Search code examples
jasper-reports

Combining Reports that use subreports already


I know that there are a few posts on how to combine 2 reports by using a subreport and such.

I am using iReport 5.6 along with Fishbowl Inventory systems.

My question has to do with 2 specific default fishbowl reports. I am trying to combine the Work Order Travelor report and the Pick Ticket report so that they print out at the same time.

The issue I am having is that the Pick Ticket report already has a subreport built into it and I am having issues passing the parameters (PT report has 12 parameters). Do I need to pass all 12 in my master report and then does that apply to the WO Traveler report too?

I simply want them to both be able to print example: 1st page is Pick Ticket and 2nd page is WO Traveler.

Thanks for any help guys!


Solution

  • You will have to pass all parameters through. You can look at the batch reports to see an example of this in action and give you something to go off of. One thing you can change however is instead of passing through the $P{moNum} and $P{pickId} you can pass through fields from the query of the top level report that you select the MO on and the query finds any associated pick ID's that are then passed through.

    You'd be looking for something like:

    SELECT DISTINCT Mo.num AS moNum, PickItem.pickId
    FROM Mo
        INNER JOIN MoItem ON Mo.id = MoItem.moId
        INNER JOIN Wo ON MoItem.id = Wo.moItemId
        INNER JOIN WoItem ON Wo.id = WoItem.woId
        INNER JOIN PickItem ON WoItem.id = PickItem.woItemId
    WHERE Mo.num LIKE $P{moNum}