iReport Input from Multiple Date Ranges

2019-09-14 12:07发布

问题:

I am using iReport and want to be able to take 4 date inputs (2 date ranges) dateRange1 and dateRange2.

Each will disaplay the amount of items and cost given within the respected ranges.

So far I have the first dateRange1 is working but I am having trouble figuring out to implament the second date range.

Here is the code I have along with some screenshots.


SELECT
 COMPANY."NAME" AS COMPANY_NAME,
 CUSTOMER."NAME" AS CUSTOMER_NAME,
 SO."NUM" AS SO_NUM,
 SOITEM."STATUSID" AS SOITEM_STATUSID,
 PRODUCT."ID" AS PRODUCT_ID,
 PART."NUM" AS PART_NUM,
 SOITEM."QTYFULFILLED" AS SOITEM_QTYFULFILLED,
 SO."COST" AS SO_COST,
 PART."ID" AS PART_ID,
 SO."DATECOMPLETED" AS SO_DATECOMPLETED,
 CUSTOMER."ID" AS CUSTOMER_ID,
 SOSTATUS."ID" AS SOSTATUS_ID
FROM
 "CUSTOMER" CUSTOMER INNER JOIN "SO" SO ON CUSTOMER."ID" = SO."CUSTOMERID"
 INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"
 INNER JOIN "SOSTATUS" SOSTATUS ON SO."STATUSID" = SOSTATUS."ID"
 INNER JOIN "PRODUCT" PRODUCT ON SOITEM."PRODUCTID" = PRODUCT."ID"
 INNER JOIN "PART" PART ON PRODUCT."ID" = PART."DEFAULTPRODUCTID"
 AND PART."ID" = PRODUCT."PARTID",
 "COMPANY" COMPANY
WHERE
 UPPER(CUSTOMER."NAME") = $P{customerID}
 AND SO."DATECOMPLETED" BETWEEN $P{From} AND $P{To}

This wis a screenshot of the design view.

回答1:

Within Fishbowl you can set any of the parameters to include a separate title. This allows you to use the same type of parameter multiple times. In the case of date ranges it's used as $P{dateRange1DateCreated} $P{dateRange2DateCreated} and then the second set would be $P{dateRange1DateModified} $P{dateRange2DateModified}.