我有一个报告,我正在尝试使用参数添加过滤器,该过滤器允许用户选择onEdit(e)
,然后显示项目的位置,按Part Number
过滤。
问题在于,出于某种原因 - 即使我将LocationGroupID set = to LocationGroupID,它也无法工作或更新。
以下是一些截图。
我正在使用iReport和Fishbowl
Location
答案 0 :(得分:1)
您遇到的问题是费用图层与位置之间没有直接关联。如果您尝试做的只是按指定位置组中的部分进行过滤,则需要通过标记(现有库存表)返回该位置。
SELECT costlayer.qty AS Qty, costlayer.orgqty, costlayer.orgtotalcost,
costlayer.totalcost AS TotalCost, costlayer.datecreated AS DateCreated,
part.num AS PartNumber, part.description as PartDescription, asaccount.name as "InventoryAccount",
company.name AS company, currency.symbol
FROM CostLayer
LEFT JOIN Part ON part.id = costlayer.partid
LEFT JOIN Tag ON part.id = tag.partId
LEFT JOIN Location ON tag.locationId = location.id
LEFT JOIN LocationGroup ON location.locationGroupId = locationGroup.id
LEFT JOIN asaccount ON part.inventoryaccountid = asaccount.id
JOIN company ON company.id = 1
LEFT JOIN currency ON currency.homeCurrency = 1
WHERE costlayer.datecreated BETWEEN $P{dateRange1} AND $P{dateRange2}
AND costlayer.statusid IN ($P!{ckShowActiveCostingLayers},$P!{ckShowFulfilledCostingLayers},$P!{ckShowVoidedCostingLayers})
AND UPPER(part.num) LIKE UPPER($P{partNum})
AND (UPPER(COALESCE(asaccount.name,'')) LIKE UPPER('%' || $P{AssetAccount} || '%'))
AND LocationGroup.id LIKE $P{locationGroupID}
ORDER BY (CASE WHEN $P{AssetAccount} NOT LIKE CAST('%' AS varchar(256)) THEN asaccount.name ELSE part.num END), part.num ASC, costlayer.id, costlayer.datecreated
这将过滤并仅显示给定位置组中的部分。通过将参数默认值设置为"%"并取消选择用作提示选项,如果没有选择,它将被所有人过滤。请注意,如果您希望查看位置组,则如果您按所有人过滤,则可能会将多个位置组中的广告资源丢弃。