0

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...

Pedram
  • 6,256
  • 10
  • 65
  • 87
KaviSuja
  • 450
  • 1
  • 9
  • 37
  • create same dataset like subreport on main report. and use the same expression to set visibility. it should work – Pedram May 31 '16 at 11:19

3 Answers3

0

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.

Nemanja Todorovic
  • 2,521
  • 2
  • 19
  • 30
0

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.

Pedram
  • 6,256
  • 10
  • 65
  • 87
  • I copy subreport dataset to main report. But here actually pass orderno. from main report to subreport dynamically. So for this newly created subreport dataset i am not able to pass parameter – KaviSuja May 31 '16 at 12:59
  • Is there any posiibility using rownumber of tablix? To hide/show one row based on next row – KaviSuja May 31 '16 at 13:00
  • Sorry but want to know, have you done something for this query? – Pedram Jun 02 '16 at 12:43
  • Can you please check it? http://stackoverflow.com/questions/37591039/look-up-function-inside-if-condition-visibility-ssrs – KaviSuja Jun 02 '16 at 12:49
0

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

Kennobie
  • 21
  • 3
  • I am using the subreport inside the row of main report's tablix – KaviSuja Jun 01 '16 at 04:17
  • I am hiding the row(contains subeport) by : IIF(RowNumber(Nothing)>0,False,True) and if i use subreport dataset in main report , there actually pass orderno. from main report to subreport dynamically. So for this newly created subreport dataset i am not able to pass parameter – KaviSuja Jun 01 '16 at 07:56
  • @KaviSuja I understand you have used row visibility property to hide/show based on your expression for Sub report. If its a single tablix, then I truly believe using the same condition (which you have used for subreport to hide) against the row which contains main tablix should be suffice. #Option 2 - You can try separating out Main and Sub report in two different tablix and proceed as per my orginal suggestion. Let me know how it goes. – Kennobie Jun 01 '16 at 08:38