pjdupreez
pjdupreez

Reputation: 717

SQL Server Report Builder Page Details Format

I have a report done in MS Access 2010 which when opened displays data which is grouped into two groups (items of type A and items of type B).

The items of type B is exponentially more than the items of type A and when you Print Preview the report, I have made it so that it only shows a total of items of type B but the full list of items of type A (in the VBA code of the Details_Format I simply prevented the items of type B being displayed).

This report has been moved over to SQL Server 2008 Reporting Services, but can I get the same formatting behaviour as on Access (hiding the detail on items of type B)?

Upvotes: 1

Views: 229

Answers (1)

Ian Preston
Ian Preston

Reputation: 39566

If you're displaying rows in a table and just want to hide rows of a certain type, set the visibility of the row to something like:

=IIf(Fields!Type.Value = "B", true, false)

Edit after comment:

I see you're already accepted the answer (thanks!) but something else that might be useful is the Globals!RenderFormat.Name report variable. In the comment you note you're using Report Builder 3.0 (SSRS 2008R2) so this is possible.

See details under Render Format.

You can hide objects based on the render format, so in your case you might want to only show Type B rows when exporting to PDF, so you could use a row visibility expression like:

=IIf(Globals.RenderFormat.Name = "PDF", false, true)

This will only show the object when it's rendered as PDF. You won't see the rows online in Report Manager (i.e. HTML).

Upvotes: 1

Related Questions