0
votes

I have one main report which shows the order details and one subreport which shows order items details. Here I passed orderno as parameter to subreport. It has multiple records group by order number. so for each order number, there are seperate set of records. I want to hide both sub report and main report when sum of demand value in subreport is zero or blank, sum of supply > sum of demand. Now I can able to hide only sub report by using the following Condition :

=IIF(Sum(IsNothing(Fields!Demand.Value)) OR Sum(Fields!Demand.Value = "") OR
(Sum(Fields!Supply.Value) > Sum(Fields!Demand.Value)), False, True)

But here, the main report data is showing which I want to hide. How can we hide both main and subreport based on value in subreport? Can anyone help me to do this? Thanks in advance...

3
create same dataset like subreport on main report. and use the same expression to set visibility. it should work - pedram

3 Answers

0
votes

You can return some flag in your main report data for example "DoShow" and then set visibility based on that flag to hide rows in main report.

0
votes

Copy Sub Report DataSet to Main Report Datasets and Use same expression for visibility.

OR

Create another procedure to set visibility.

For example: We can create one stored procedure to hide both "Sub report and Main report" - when sum of demand value in subreport is zero or blank, sum of supply > sum of demand.

Let me know, if you need more help.

0
votes

Use the same condition you have used to hide sub report in main report as well.

I am assuming you are using a separate tablix for main and sub reports. If so, right click on main report tablix -->tablix properties --> Click on Visibility --> Now click on "Show or Hide based on expression" and paste the IIF condition which worked for subreport over here. This should definitely work. Give it a shot and let me know how it goes. Mark answered if it works please.

Cheers and all the best