I am working with a set of reports that were designed and converted over into Visual Studio 2008 BIDS.
I have one report that does the following, it has no use of the @DistID parameter in the SQL code. I do have a DistID parameter setup.
When the report is viewed the report will load just fine, when the user enters a number into the DistID Parameter box it will reload the report with just that single 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
There are other paramaters setup @fromDate @toDate etc that also work just fine.
I have another report where I need the same functionality, except for DistID I need ItemId. I have setup a parameter and expected it to work the same, but the report will always load all items, even when I enter an item number into the ItemID Text Box.
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
Both report were made a long time ago. I am modifing the item report to have the same functionality as the distID in the other report but I cannot seem to get this to work.
I have searched both reports for any differences that I am missing and I cannot find any. The other oddity is when I add another parameter in the DistID report to break it down further by orderID that as well will not work.
I have found nothing in the Filters, Variables or Code section of the report. I am not sure what I am missing here.
There appears to be more than one question here. I am going to concentrate on the (implied) first question: why doesn’t the second report select a single ItemID in the same way that the first report selects a single DistID?
I think the underlying cause is that there is more going on in the first report than has been stated – given its description so far, when the user enters a number into the DistID Parameter box the report should not reload with just that single DistID. It therefore sounds as though there is an additional filter on the table/tablix report object being used to display the output, or possibly the visibility of the detail rows has been made conditional on the parameter value.
If this is the case, you could replicate the functionality of the first report in the second by duplicating whichever method it has used to display the single ID. However, given the maintenance difficulties this method has produced (ie. this question) I strongly recommend you add it to the query selection criteria instead.