how to hide detail section in reporting services in code

  • I am using a rdlc fiel for showing two different different of same format. I want to hide the detail section for one report and show it for other. So when bind the rdlc to the report viewer can i hide detail section in the code.

    Please let me know if anybody implemented this and give me code if possible.

    Any inputs would be greatly appreciated

    Thanks,

    Suman

  • If I understand you correctly you have the same rdlc you want to display twice, but 1 time you want the details hidden and the next you want it visible.

    I think the best and easiest way to accomplish this is to place a hidden parameter on the report for the Hidden property of the detail row. In the rdlc you would set the Hidden property of the detail row to =Parameters!Hidden.Value. Then in the .NET code use ReportViewer.LocalReport.SetParameters to set the paramter to TRUE when you want to hide the details and FALSE when you want to show the details. You could also supply a default within the report definition and only set the parameter in code for the the opposite.

  • Yeah I've used a similar technique often, allowing my users to choose between a summary or detail view of certain reports that didn't lend themselves to drilling all that well. I just created a parameter that the user could select to show detail (1), summary (0) or both (2). I used a matrix to do my summary and a table to show my details, then used the following in the visible value for each item...

    =IIF(Parameters!ReportType.Value = 0 OR Parameters!ReportType.Value = 2, false, true)

    OR

    =IIF(Parameters!ReportType.Value = 1 OR Parameters!ReportType.Value = 2, false, true)

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I have done the same way but i am able to see empty spaces in between which makes my report look not better. How can we make the height of that section to zero

  • Are you hiding the whole report or just the details row? When I have hidden the details row I have never seen a blank area.

  • Is the Canshrink property set to False by chance?

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I have applied the hidden expression for the entier detail section instead of each control. This is solving both the problem of hiding and also the eliminating the empty spaces i.e., its hieght is zero when i export it to pdf or excel.

    Thanks for your answers.

    Suman

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply