我正在处理一组设计并转换为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