On a report I have I have a hidden table which I am trying to get values from for a total. On a seperate table, I have an if statement that checks if a product # matches one on this table. This works fine if there is only one record in the hidden table. If there are more than one records, the ReportItems call only see's the last textbox (the last record) of the hidden table. Here's the total expression I use
=IIf( sum(Fields!PickupDeliveryDetails_New.Value)+ sum(Fields!PickupDeliveryDetails_Extra.Value) <= 0, 0 ,((sum(Fields!PickupDeliveryDetails_New.Value) + sum(Fields!PickupDeliveryDetails_Extra.Value)) /
(ReportItems("textbox36").Value
)
)
* (Fields!Actuals_TotalPTypeCharge.Value)
+ (IIf(ReportItems("table6"."TableColumn1").Value = Fields!Product_BPCSNumber.Value, ReportItems("textbox50").Value ,
IIf(First(ReportItems("table6"."TableColumn1").Value) = Fields!Product_BPCSNumber.Value, First(ReportItems("textbox50").Value) , 0 ) ) )
)
Any help on this would be greatly appreciated.
Morgan

can't get multiple values using reportItems
Anurva
That piece of code was not working. Heres the working code.
=IIf( sum(Fields!PickupDeliveryDetails_New.Value)+ sum(Fields!PickupDeliveryDetails_Extra.Value) <= 0, 0 ,((sum(Fields!PickupDeliveryDetails_New.Value) + sum(Fields!PickupDeliveryDetails_Extra.Value)) /
(ReportItems("textbox36").Value
)
)
* (Fields!Actuals_TotalPTypeCharge.Value)
+ (IIf(ReportItems("textbox27").Value = Fields!Product_BPCSNumber.Value, ReportItems("textbox50").Value , 0 ) ))
Shawn Twenter
anders_sms
That wouldn't work because I need seperate values for each product type total. There is a group by product # but there are multiple product #s.
I have solved my problem by getting the results from the hidden table in the second table (i got the values in the dataset by using left outer joins).
I would still like to know if there is a way to do what I was trying to do if it ever came up again and it couldn't be solved in the query.