Tuesday, December 18, 2012

Lesson 8: Miscellaneous options in SSRS (Tutorial)


1. Adding a new concatenated column

Below we can see a table and we want to concatenate Title with Genre to get Full Movie Title with genre.






















First we will add a new column to the extreme right end “Movie Full Name”.










Right click the cell where we want to perform concatenation and then go to Expression.












Type the expression as shown in below image. Click Ok. 


NOTE: If you field is not string data type (for instance integer) you might have to use function to convert it to string.





















Preview the report.




















2. Adding a new calculated column

Choose Data Set. Right Click and choose Add Calculated field.










The DataSet Properties window opens up. Enter a Calculated field Name “MovieWithGenre” and click on the Expression button (fx).






















Next add the below expression in the expression window. Click Ok.





















The Calculated column appears in the dataset.

















Drag and drop the calculated column in a new column in the table in the report designer.











Preview the report.

















Using IIF in expression

Add a new column to the table in the report designer.










In the expressions window enter the below code. Click Ok.



















Preview the report.






















Adding Alternate color to table rows

Select entire row. Go to Properties, Find Background property and click on ‘Expression...’








In ‘Expression’ window type: 

=IIF((RowNumber(nothing) MOD 2)=1,"Gainsboro","Transparent")





















Preview the report.





















Sorting Columns in SSRS

Right click on the column header and choose Textbox Properties.

















Choose Interactive Sort from the Textbox properties dialog and Check the checkbox for Enable interactive sort on this Textbox, Choose Title field from the Sort by drop down.





















Preview the report.
























Adding custom paging in SSRS

From Main Menu, select Report, and the click on Add page footer option.












Let us add four textboxes from the Report Item toolbox onto the designer as shown under.
















Choose the 2nd textbox and click on the Expression.
















From the expression window that opens, let us write the expression.





















Similarly for the 4th Textbox, let us write the expression as = Globals!TotalPages. Click Ok.





















The report looks like below.





















Preview the report.






















No comments:

Post a Comment