

to create and populate the 'SP500' table. in a 'SQL Server Management Studio' query window. Execute the report to demonstrate that the custom code worksĭownload the resource file 'sp500hst.zip' to the folder 'C:\testfiles\' and extract its contents.Ĭreate and select a database named 'TestDB' if it does not already exist and execute the following SQL code.Add expressions that reference the two custom code functions to cells in the report.Add custom code to the report that defines two functions that set the background color of cells.Create an SSRS report based upon the parameterized query.Create a single-parameter query that selects data from the table.Create and populate a table containing stock market data.


Changing the background color of rows can be a valuable method of visually grouping data in a Reporting Services (SSRS) report, as demonstrated in the screen shot below.ĭynamically changing the background color requires custom code that can compare the current value of a field with its value in the previous record and cell expressions that toggle the cell background color if the two values are not the same.
