我正在處理一組設計並轉換爲Visual Studio 2008 BIDS的報告。報告中心BIDS報告參數
我有一個報告執行以下操作,它沒有在SQL代碼中使用@DistID參數。我確實有一個DistID參數設置。
當報表觀察時,用戶輸入一個號碼到DistID參數框它將重新裝入只是單一DistID報告的報告將加載就好,
SELECT o.Orderid,
o.Distid,
it.invoicetypedesc,
SUM(ol.Volume * ol.Quantity) AS Volume,
SUM(ol.Amount) AS Amount,
SUM(retailPrice * quantity) AS Retail,
o.TaxAmt,
o.ShipAmt,
o.PostAmount,
o.Status,
w.WarehouseDesc
FROM Orders o
inner join Orderlines ol on o.orderid = ol.orderid
Inner Join Warehouse w on o.warehouseid = w.warehouseid
inner join invoicetype it on o.invoicetype = it.invoicetype
WHERE o.OrderDate between @fromdate and
@todate + ' 11:59:59 PM' and
o.EnteredBy in (@EnteredBy) AND
o.InvoiceType IN (@InvoiceType)
Group by o.OrderID,
o.DistID,
it.InvoiceTypedesc,
o.taxamt,
o.shipamt,
o.postamount,
o.status,
w.WarehouseDesc
還有其他PARAMATERS設置@ fromDate @toDate等,也工作得很好。
我有另一個報告,我需要相同的功能,除了DistID我需要ItemId。我已經設置了一個參數,並希望它的工作原理相同,但即使在ItemID文本框中輸入項目編號時,報告也會始終加載所有項目。
select ol.itemid,
i.description,
it.invoicetypedesc,
sum(ol.quantity) as quantity,
sum(ol.amount) as amount,
ol.volume,
sum(ol.volume * ol.quantity) as totvolume,
o.warehouseid,
w.warehousedesc,
o.invoicetype,
ol.retailprice,
ol.wholesaleprice,
inv.sku
from orders o
inner join orderlines ol on o.orderid = ol.orderid
left join items i on ol.itemid = i.inventoryid
left join inventory inv on ol.itemid = inv.inventoryID
inner join invoicetype it on o.invoicetype = it.invoicetype
inner join warehouse w on o.warehouseid = w.warehouseid
where o.orderdate between @fromdate and @todate + ' 11:59:59 PM' and
ol.quantity > 0 and
o.EnteredBy in (@EnteredBy)
group by ol.itemid,
i.description,
it.invoicetypedesc,
ol.volume,
o.warehouseid,
w.warehousedesc,
o.invoicetype,
ol.retailprice,
ol.wholesaleprice,
inv.sku
這兩個報告都是很久以前做出的。我正在修改項目報告以與其他報告中的distID具有相同的功能,但似乎無法使其工作。
我搜索了兩份報告,發現我缺少的任何差異,但找不到任何差異。另一個奇怪的是,當我在DistID報告中添加另一個參數,並通過orderID進一步分解,這也是行不通的。
我在報告的篩選器,變量或代碼部分找不到任何東西。我不知道我在這裏失去了什麼。
請您澄清一下您想問什麼問題,在這裏? – 2011-12-17 17:45:28