564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Controlling the number of rows per page in Reporting Services
Part four of a four-part series of blogs
Unfortunately, Reporting Services doesn't have a simple setting that allows you to control the number of rows you see on each page. However, you can control this using a clever combination of an expression with a grouping level. Read this blog to find out how!
Although it's nice to be able to control the number of records per page in the design view of a report, sometimes your users will want to be able to choose how many records are displayed when the report is running. You can give them this power by linking your group expression to a parameter.
The first step in this example is to create a parameter that allows your users to enter a number corresponding to the number of records they want to view on each page. The diagram below shows how to add a parameter to a report:
In the Report Data window, right-click the Parameters folder and click Add Parameter...
You can use the following dialog box to configure the parameter you have just created:
Use this dialog box to set up the parameter. The numbered steps are described below.
It's also worthwhile adding a default value to the parameter so that you see a set number of rows per page when you first open the report. You can do this on the same dialog box, as shown below:
Use this page of the dialog box to set a default value for the parameter. The numbered steps are described below.
The final step in making this technique work is to 'plug-in' the parameter to our group expression. To do this:
Right-click the name of the group and choose the option shown here.
Use these options to launch the expression builder.
Use the mouse to highlight the value you typed into the expression earlier.
Double-click the name of a parameter to replace your value with a reference to the parameter you created.
The final thing to do is check that your system works! When you preview the report you should see that you can type a number into the parameter box at the top and click View Report to change the number of records on each page.
Type a number into the box at the top and click View Report.
Your parameter won't work if you type in a number that exceeds the maximum number of rows that will fit on the size of page you are using.
|Parts of this blog|
25 Aytoun Street