Beginning SQL Server 2005 Reporting Services Part 2

Continuing his in-depth tour of SQL Server 2005 Reporting Services, Steve Joubert demonstrates the most common features and functions used to develop effective and dynamic reports.

We will investigate:

  • Use of expressions that allow you to dynamically control nearly every aspect of reporting from control properties to data binding
  • Common functions that allow run calculations and manipulate data within the report itself
  • Custom code, used to build your own library of functions within the report.

We’ll also set up a Matrix control and create a sub-report. Lastly, we will add some flair to the report by adding dynamic drills and sorting.

Getting started

In order to follow my examples, you will need to have SQL Server 2005, SQL Server 2005 Reporting Services, and Visual Studio 2005 correctly installed and configured. If you need some help with this, please refer back to the links in Part 1 of this series. Next, download the code file for this article (see the Code Download link at the bottom of the article). The code file contains a sample Visual Studio project and a SQL Script for creating the ReportDemo database. If you’ve not done so already, go ahead and create the database using the ReportingDemoDatabaseScript.sql script or, alternatively, by restoring the provided ReportingDemo.bak file.

Now start a new Business Intelligence project in Visual Studio 2005 (or using BIDS, which installs with SQL Server 2005). Select Project | Add Existing Item function to add to the project the shared datasource (ReportDb.rds) and the sample report, FirstReportMan.rdl. Next, open up the shared datasource and set the server, database, login and password to point to your copy of the database. We will start with the FirstReportMan.rdl report, so double-click on it in the solution explorer to load it into the designer.


An expression is a short statement, written in code, which sets the value of a property. An expression can set the value of a property based on just about any data available in the report: parameters, report global values, fields in a dataset, and built-in functions.

SSRS 2005 has made some drastic improvements in how expressions are created. It now supplies an intuitive expression editor. If you scroll through the Properties window, you will notice that most of the properties of controls on the report can be hard-coded or can be set through expressions. (That’s the <expression> option you see everywhere.) You will also see buttons labeled fx in the pop-up Properties dialog. These buttons will access the expression editor.


The expression feature makes SSRS 2005 into an incredibly versatile tool, because it allows most aspects of the report, from the data it shows to how it shows it, to behave dynamically. Rather than using a hard-coded value for a particular property, the SSRS resolves the expression to set the value for the property.

Looking at our report, let’s say we want it to highlight all the customers from a particular State. We could use the expression:

If we apply this expression to the detail row in the table and run the report it will bold the text for each row where the value of the State field is California. That’s great if the data from California is all that you are interested in. However, it would be ridiculous to have one report for each state, so let’s make this expression even more dynamic by adding a report parameter that will determine which State is highlighted when the report is run.

First, let’s add the new parameter to the report. Open the FirstReportMan.rdl report and navigate to the Layout tab. From the Report menu select Report Parameters. When the dialog window opens, click the Add button at the bottom of the screen. Call the new parameter ‘HighlightState’ and set the available values as follows:

California CA
Florida FL
Louisiana LA
Illinois IL
Texas TX

Now click on OK.

You’ll see that when setting up a list of pre-defined values for a parameter that there is a ‘From Query’ option. You can use this option by defining a dataset on the data tab of the report designer. For example, if we had a State table in the database we could define a dataset to retrieve the data for the parameter dropdown from that table. Once you choose the ‘From Query’ option, you select the dataset, the value field (this is the field from the dataset that contains the value passed to the report) and the label field (the field from the dataset that contains the value displayed to the user when they are prompted for parameters).

The next step is to set up the expression. Click on the table control on the report. When the table control is selected, an extra control tab appears at the top and left of the table. Click on the little ‘row maker’ icon, just to the left of the detail row. This allows you to set properties for the entire row. In the properties window select FontWeight and choose <expression> from the drop-down list to open the expression editor. Typing =iif( should give you Intellisense. You can use the expression builder to create the following line of code:


The iif is a flow control statement commonly used in SSRS expressions. Its format is:

iif (boolean statement, true result, false result)

If the boolean statement is true, then the true result is returned, and if not, the false result is returned. In this case, the boolean statement is asking: ‘Does the state code equal the state code that was passed to the report? If it does, return the word ‘bold’. If it does not, return the word ‘normal”. The value returned is then used to set the property for that instance of the row.

Now switch to the Preview tab and select a State to highlight. When the report runs, all the rows with customers from the selected State should be displayed in bold.

Common functions

Let’s navigate back to the expression editor. In the bottom half of the screen there are three columns. The first column lists different categories for building expressions. The last option is Common Functions. Expand the Common Functions node. Click on the Date & Time category. In the next column, double-click on one of the functions. You will see that it is added to the expression box at the top of the dialog box. Next, simply put the cursor in the expression box after the function. If you then type in the opening left bracket you should instantly see Intellisense for the function you selected.


Let’s use the Year function in the report to display only the year in which someone was born, instead of their full birth date. Right-click on the field that displays the date of birth and select Properties. On the General tab, find the Value field and click the fx button to bring up the expression editor. Change expression to read.

There we have it. It’s a good idea to preview the report now.

Also of note here are the aggregate functions. These functions assist you in working with all of the data in a dataset. For example, let’s say your report is an order form with a list of items and their prices. You can use the Sum function on the Price field to create a total price on the report. In a different example, if you had a report that listed all the purchase dates and the total amount of each purchase, you could use the AVG function to get the average purchase price for that customer.

Global variables

Let’s go back again to the expression editor. This time, click on Globals in the first column of the expression editor. In the second column, you will see the list of the global variables that are provided to the report.

In this example, we are going to use the global variables to create a page-numbering scheme for our report. First, add a footer to the FirstReportMan.rdl report. You enable this by going to the Layout tab and selecting the Report Footer option from the Report main menu. Now that you have a footer, drag four text boxes into the footer section. Set their font properties to 8 pt, bold. Set the text for each text box as follows:


Switch to the Preview tab and run the report. You will now have a footer on each page that looks something like ‘Page 1 of 5’.

Some other globals worth noting are:

  • ExecutionTime – this tells you how long it took to run the report
  • ReportServerUrl – this allows you to verify that you are getting your report from the correct source
  • UserID – this shows under which User ID the report was run

You can use these global variables to build some basic diagnostics into your reporting. You could also add these variables to the report footer and use a parameter to hide or show them. That way, even in production, your users can see a tidy, clean report, but you can see the same report with all the extra information on it.

Custom functions

There are about 100 common functions in SSRS 2005, and they can handle most of what you will need to do. Occasionally, however, you will still need to set an expression with more control than the common functions can manage. So, to make SSRS even more flexible, you can write custom VB.NET or C# functions and use them in expressions.

Now we are going to add a custom function to the FirstReportMan.rdl report.

Open the report and navigate to the Layout tab. From the Report menu select Report Properties and then jump to the Code tab. We are going to write a custom function that returns a different color, depending on the value that is passed to it. We will then use that function to set the background color for the status field in the report detail table.

Copy the following code into the code window:

Click OK and close the window.

The full list of available colors is found in the Color dropdown list in the properties window.

Now that we have a function that returns color names we need to wire up that function to an expression. Click on the Customer Status cell and open the Properties window. Find the Background Color property and choose Expression from the dropdown. Add the following line of code to create an expression:

When the report runs and this expression is resolved, SSRS will call your GetColor function and pass the value of the customer status for that instance of the row to the function. The function takes over and decides which color should be returned. SSRS then uses that value as the value for the background property for that cell.


Please note that custom functions must be called using =code.<myfunction>.

Now navigate to the Preview tab and run the report..


A subreport is a report that is embedded into another report. Subreports can take parameters and execute their own datasets. A key aspect to note is that a subreport in SSRS is actually just another report (unlike some reporting tools, where a subreport is a special construct). In fact, in SSRS you can execute a subreport on its own.

To add a subreport to a report, you simply drag a subreport control onto the report and tell it which report to display. If the subreport requires parameters, you have to tell the main report which value to pass to the subreport. It’s actually very simple.

Let’s add a new report to the project and call it MainReport.rdl. Create a new dataset using the shared datasource and the query:

Switch to the Layout tab. Drag a table on the report detail area. Set up the first column to display the customer’s first name (by dragging that column from the Datasets tab into the Detail row) and set up the second column to display the customer’s last name. Label the third column ‘Address’. Preview the report, just to be sure it works.

Create another report, and call this one MySubReport.rdl. This time, create a dataset that uses the shared data source, and use the following query text:

In the Layout tab, use text boxes to create the address layout, as shown in figure 5. You can simply drag the text boxes onto the screen by clicking on the field in datasets tab and dragging it onto design surface. You will also note that when you do this, the expression used to set the value property for the textbox uses the First() function. This function will use the value from the first row returned by the dataset. All other rows returned are ignored.


Now preview the report and use ‘100’ for the CustomerID parameter.

Let’s jump back to the MainReport.rdl. To embed the subreport, drag a SubReport control into the detail cell for the column you labeled ‘Address’. Right-click on the SubReport control and select Properties. In the Properties dialog choose MySubReport from the subreport dropdown.


Next, switch to the Parameters tab. This is where you connect your subreport to the main report. You do this by indicating which value from the main report is to be passed to the subreport to fulfill its parameter requirements.

In the Parameter Name column choose CustomerID and in the Parameter Value column choose =Fields!CustomerID.Value. This will wire up the subreport to whichever customer is being displayed in the row of the table.


Click OK to close the dialog, and then preview the main report.

The Matrix

It’s this question that drives us, Neo. What is the Matrix? OK, I’ll stop right here. You can insert your own slam to the second two movies. However, there is a really cool control in SSRS called the Matrix control. The Matrix is used to create pivot table style reports. We are going to set up a simple Matrix control to show us which customers, in which State, have which status.

First, start a new report called MatrixReport.rdl. Add our standard dataset where you use the shared data source, and then add the Select * from Customer query.

Navigate to the Layout tab and drag a new Matrix control onto the page. Where it says Rows, drag the State field from the dataset. Where it says Columns, drag the CustomerStatus field from the dataset. Drag first name and last name into the data area on the Matrix control. After a little formatting, it should resemble this:


When the report runs, it looks like this:


Adding drill downs

The drill down functionality in SSRS allows you to have areas of your report that can expand and collapse, much like a tree view.

First, start a new report called AdvancedTable.rdl. Add our standard dataset, where you use the shared data source and the Select * from Customer query.

Navigate to the Layout tab and drag a new table control onto the page. The first thing we need to do is to add a group to the table. Click the table to highlight it, then right-click on the little box with three horizontal lines in it that appear at the left side of the table at the beginning of detail row. Select Insert Group. When the Group Dialog appears use =Fields!State.Value as the expression, so that the report now groups on State. Now drag the State field into the first column on the Group row. Next, drag the First Name, Last Name and City fields into the detail row. Add some formatting, and preview the report.


We’ve now performed a grouping, but we still have to enable the drilldown. Click on the table to highlight it. Right-click on the nub that appears, just to the left of the detail row. Select Properties. When the Properties window opens, expand the visibility section. Set the Hidden property to True and set the ToggleItem property to State. The Hidden property determines the state of the row when the report is first run. If we set it to True then the data is collapsed and hidden. By setting the ToggleItem property to Statee, when the report is run a little + sign appears next to it when the report is run and it works like a tree view.

Switch to the Preview tab and run the report. Now only the States appear, but you can see the customer in each State by using the tree-style +/- controls.


Adding dynamic sorting

It is incredibly easy to add sorting to your table. Let’s re-open the FirstReportMan.rdl report. Navigate to the Layout tab of the report designer. Click in the cell labeled First Name in the header of the table. Right-click and select Properties. Switch to the Interactive Sort tab. Check the checkbox for ‘Add an interactive sort action to this textbox’. Next, set the Sort expression to the value that is displayed in the column – in this case =Fields!FirstName.Value. Now repeat this process for the rest of the report.


Preview the report, and you should have interactive sorting on each column.


Wrap up

I hope this look into some of the more advanced features of SQL Server Reporting Services 2005 will help you make your reports more interactive and better adapted for your users. In Part 3, we will take an in-depth look at the chart control and its diverse set-up functionality.

Steve Joubert continues this introductory article in Beginning SQL Server 2005 Reporting Services Part 3: The Chart Control. If you enjoyed this article, make sure you see Ten Common SQL Server Reporting Services Challenges and Solutions and other Reporting Services articles in our Reporting Services  section.

If you found Steve’s article useful…you may be interested in Red Gate’s SQL Doc, a fast, simple documentation solution for SQL Server 2000, 2005 and 2008 databases.


Tags: , , , , , , , , , , ,


  • Rate
    [Total: 1    Average: 5/5]
  • Anonymous

    Beginning SQL Server 2005 Reporting
    thats a wonderful article Steve. very simple and to the point. it cleared many of my How-tos.
    Thanks again

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Cool.. Easy to follow..

  • Anonymous

    Beginning SQL Server 2005 Reporting
    the article is very good and easy follow. I find it very useful to begin with. I would appreciate if you let us know when you will be publishing part 3.

  • Anonymous

    With SQL Server 2005 I have created and link a sub report into my main report. However, do you know how to put this sub report into an existing table.

  • Anonymous

    About Artical
    its great artical for Beginner.

  • Anonymous

    can you tell me how we can send the rdl report to printer through the 2005 code. i want to send the rdl report to printer with out preview the email address is if you find any result please share with me. waiting your kind response.

  • Anonymous

    For Oracle Database
    Please note: If you are using Oracle database, the parameter should be referred using a ‘:’ instead of ‘@’ in the given example:
    SELECT Address, City, State, ZipCodeFROM CustomerWHERE (CustomerID = @CustomerID)


  • Anonymous

    Quite Informative
    Keep up the good job Steve!
    Awaiting for Part 3 and Part 4

  • Anonymous

    We need more articles like this!!

  • Anonymous

    Beginning SQL Server 2005 Reporting
    I like it.
    More advance please!

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Great article. Will there be any articles on how to set up reports programmatically?

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Great article. Will there be any articles on how to set up reports programmatically?

  • Anonymous

    Where to…..
    Cool. Steve

  • Anonymous

    Beginning SQL Server 2005 Reporting
    This article guide me to generate my first sub report. Thanks a lot Steve

  • Anonymous

    Export to XLS
    Hey Great Solution..
    Actually I’m stuck in one report have page breakes agfter some tables. there are aroud 5 pages. now while exporting this report to .xls is gives up only 2 pages i.e. 2 sheets i’m loosing other data i.e. page 3,4,5

    But in PDF, HTML it works gr8.

    It will be great if you can give me answer

  • Anonymous

    Beginning SQL Server 2005 Reporting
    I guess my search for ‘SSRS How tos’ stops here.Very good articles Steve.

  • Anonymous

    Beginning SQL Server 2005 Reporting

  • Anonymous

    This is great article. But how do we deploy this project to the customer?

  • Anonymous

    Beginning SQL Server 2005 Reporting
    This is good for beginer. But some advance level article will be very helpfull.

  • Anonymous

    ssrs 2005
    Thanx steve…great answer

  • Anonymous

    Good Article again Steve. Looking forward for your Part 4 and many more articles.

  • Anonymous

    Fortunate to have Steve Joubert
    Hi Steve Joubert,

    I am very fortunate to find this link in google.
    I could learn Reporting services with in no time
    heartfully telling earth is evolved just to have a great person like you.

    Thank you very much.
    Srinivasarao Pemmasani

  • Dayashankar

    Beginning SQL Server 2005 Reporting
    This is good Article.Some important and interesting feature is mentioned clearly.

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Really very nice and very informative article.
    could you please tell me how to add a sum row under each grouping section. because when adding aggregate method in footer section for group report it shows sum field for each row in group. we need it as a whole for a grouping field.

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Awesome man…

  • Anonymous

    Beginning SQL Server 2005 Reporting
    Really helpful for the beginners..
    Keep it up.

  • Anonymous

    Steve you’re doing a wonderful job – but I get the feeling you’ve skipped over ReportingUser table…

    My Report wouldn’t work until I created such a table and put a couple of entries in it…

    Can I really be the first one to have encountered this problem?

    Or am I just being really thick here ?

  • Anonymous

    RS with Oracle Parameter
    Zavier, thanks for such wonderful tips in case of Oracle database.Use :(Oracle) instead of @(SQL Server) before parameter variable in parameter based report query.


    SELECT Address, City, State, ZipCodeFROM CustomerWHERE (CustomerID = :CustomerID)


  • Anonymous

    Thanks alot
    That was so helpful

  • Anonymous

    Small Doubt
    Can we get sub-report value in main report ?

  • Anonymous

    Its really good & helpful for begginners’.
    Please send me SSRS related questions & answers to the following email id:

  • charbel

    Beginning SQL Server 2005 Reporting
    great article and very helpful
    10x a lot

  • Navneet Trehan

    SQl Server 2005 Reporting
    Very good article. Thnx.

  • Anonymous

    two charts in the same report
    Can we have 2 different charts from 2 different datasets in the same report? Is this possible?
    I don’t want the user to keep clicking on each folder/file for the reports, as soon as the user clicks a report, the report should give them all graphical charts at one shot like DashBoard.

  • Anonymous

    two charts in the same report
    Can we have 2 different charts from 2 different datasets in the same report? Is this possible?
    I don’t want the user to keep clicking on each folder/file for the reports, as soon as the user clicks a report, the report should give them all graphical charts at one shot like DashBoard.

  • Anonymous

    Custom Code
    Hi Steve,
    Good article! One thing about the custom code section. You say: “…you can write custom VB.NET or C# functions…”. I tried writing a basic C# function and the report can’t compile. The same function written in VB works fine. What could be the problem?

  • Anonymous

    subreport out parameters?
    someone above wrote:

    “Can we get sub-report value in main report ?”

    And I second that question: is there a way to use subreport parameters as out parameters?

    For now, my main report has to duplicate some logic already in its subreports so that it can show a total. This solution works, but it’s inefficient and hard to maintain.

  • Anonymous

    Header and Footer In Sub Reports
    How can we add the header and footer in subreports which are present in main report.
    Plz reply me on

  • Anonymous

    Good work
    this is simple and excellent demonstration of SSRS.
    for more information you may also conntace with me at

  • Anonymous

    How about addinf footer to a Matrix ?
    Well, Columns are never the same (Dynamics) so how to add a summary footer ?

  • Anonymous

    Good work.
    Great articles. Keep it up. You ease the developer pain. Hooray!!

  • Anonymous

    Very Good work
    It is very good article for beginners, I am working on Sub report this article showed me how to create with parameter and link to main report. Once again it is very nice and neat article for beginners.

  • Anonymous

    Good Work
    I want to generate a report for all the employees who is working in an organisation.Now i want to calculate the HoursWorked by the employee for each day in a month.If any employee tooks sickLeave r CasualLeave i want to make that column to be empty.If any employee takes 1/2 day leave i want that column to be 4hrs.Actually,total HrsWorked per day is 8hrs.If u had any idea please mail me to this ID:
    It’s very urgent.Please help me.
    Sorry for my english.

  • faceall

    Great Work
    I like this article very much and it is very helpful for those who want to start working with sql reporting service.

  • Anonymous

    Great Help
    I truly liked the article very much . I am very new to reporting services and both the articles of yours have made me confident enough to start working with it . Thanks

  • Patrick Index

    Fantastic article
    Thanks Steve for another cracker.

  • Anonymous

    Great Help
    Thanks Steve. I Like this Article,Its really good and helpful for beginners.

  • Anonymous

    Please Help Me
    There r 2 dataregion tables one table has 2 pages and 2 table has only one page satic data i want this static data should repeat on every page what should i do for that please help me and mail me on this id

  • Anonymous

    Missing data from the Matrix
    Great explanation…. but there is missing data from the matrix. There are 10 records in the database but only 7 records show up. For State= CA and Status = 100 we should not only see Simon Cowell but Randy Jackson and John Locke as well. Is this because we are only in preview mode – yet that can’t be said for other reports we have seen in preview mode – what’s up?

  • Anonymous

    About Article
    ITssssssss Great Steve!
    U have done such a gr88 job,,this article really helped me out thanksssss a lot,,looking for more articles on this subject

  • Anonymous

    Great Article – More on Dynamic Drill Downs…
    First, great article.
    Question – After utilising a drill down on a date, can you default to the current date and expand just that level of grouping ?

    Any advice/guidance greatly appreciated!

  • Anonymous

    Header and Footer In Sub Reports
    Your articles are very good for a first approach to “Reporting Services 2005”.
    I have this problem: subreports ignore the header and the footer page, how can I print at the begin and at the end of my pages?

    Thanks for your help!
    (Please mail me on )

  • Elaine

    Jumping to another report
    Great Article, i have created a matrix from this. I have links on the colunms names to allow the users to jump to the more detailed report. However i am using date parameters on the main report and say if i put in a range 01-01-07 to the 31-01-07 and i want to see that range in the ‘linked’ report how do i do this. I have already set date parameters on the navigation panal but it doesn’ seem to work. Any advice would be muchly appriciated . please email on Thanks again.

  • Venkateswarlu.Cherukuri

    About Atricle
    It is very good article for beginners, I am working on Sub report this article showed me how to create with parameter and link to main report. Once again it is very nice and neat article for beginners.

  • Venkateswarlu.Cherukuri

    About Atricle
    It is very good article for beginners, I am working on Sub report this article showed me how to create with parameter and link to main report. Once again it is very nice and neat article for beginners.

  • Karthik

    how to do subreports in SSRS
    Can you tell me how to do a sub report in SSRS 2005. Can you please send me a sample coding based on this topic
    My email id is

  • Anonymous

    Re: ssrs 2005


    I created a report with cascading parameters and every thing is fine but I want to view the report with out clicking the view report button I want to genarate the values as soon as I selec the values in the parameter. Is ther any such option in SSRS 2005? Please if you know the solution please let me know.

    I can be contacted at

  • Anonymous

    how to do subreports in SSRS
    Can you tell me how to do a sub report in SSRS 2005. Can you please send me a sample coding based on this topic
    My email id is

  • Rajan

    SQL Report Server Sort Problem
    Very nice article. But the thing is when we deploy reports to the report server and try to view from there through IE (Internet Explorer), the basic Interactive Sort is not working. Any Idea? Please let me know. My Email ID:

  • Roger

    About Article
    An excellent article Steve. Many thanks for this quick start to SSRS.


    adding a dropdown list to report
    nice article !
    how can we add a dropdown list to rdl report

  • Muralidhar

    Absolutely helpful article but I still have some doubts regarding sub-reporting part.
    When i tried out a similar example shown in the above article ,I get an error which says
    Error is showing subreport.

    Can anyone help me out in this?
    Thanks in advance.
    You can reach me on

  • Anonymous

    really good one
    it really helped a lort

  • Anonymous

    Good article.

  • Anonymous

    Good article.

  • Anonymous

    Thank you!
    A really helpful, clear walk-through. Now, to try my first solo report…

  • Wonderer

    Is there a way to sort multibple subreports on the main report?
    Example: SubRpt3, SubRpt2, SubRpt1

    I’d like to control the appearance of each sub report control. I don’t see the expression on ReportName property of Subreport control to set it in run time.

  • Ajay

    too good !!!!
    This is a very good article for all the beginers

  • Anonymous

    how to handle duplicate records in ssrs
    how to handle duplicate records in ssrs?
    please reply to

    Thanks and Regards,
    Narasimha Murthy.V

  • Anonymous

    Awesome, Very nice work
    I Couldn’t find any nice tutorial , you’ve done awesome job, I was able to make sub report in minutes. Looking forward to have more nice tutorials for SQL 2005 from such nice team.

    Thanks !!!


  • Anonymous

    Quick & easy to understand!

  • Ganesh

    custom datasource error

    i have wrriten custom function in code part in that function we are passing parameter

    for ex : code.Get(Parameters!param.Value)

    ,while previwing report its generating report after deploying it displays error …

    i hope parameter is not passing to that function

    plz help me out

  • Anonymous

    advanced my azz
    this article was far from “advanced techniques in ssrs”. worthless…….

  • Koketso Mashao

    Thanks a Million
    This is a very very helpful exercise for beginners…Keep it up.

    Koketso Mashao
    South Africa

  • WallyG

    SSRS Part2
    Really good ‘once over’ of the highpoints of SSRS. I used it, and the other parts, as a quick refresher for an interview as I’d been away from SSRS for awhile. Thanks.

  • N Talwar

    I do appreciate this great tutorial!
    I’m really on a roll here, learning SSRS through your tutorials, and enjoyed this one as much as the first.

    I did have a question in my mind while I was going thru Part 2: I noticed that when I grouped by State I didn’t have to presort the query or anything like that prior to that, so does the grouping take care of that or would I normally be needing to do that myself but I guess I’ll find out about this sooner or later or if I play around a little more.

  • Anonymous

    thanks for great work
    Great Article. I like every bit of it.
    Thanks Steve

  • Sarah Grady

    Anonymous Comments Disabled
    Due to a high volume of spam, anonymous comments have been disabled.

  • db042188

    I believe this global variable is actual run date and time, not duration. But if anybody has an elegant way of displaying duration, I sure could use it.

  • undershock

    rs2005 part2
    Easy explained the examples are still implemented but the guide walk the reader to understand every steps.One of the best I fuond in the net.

  • kickass

    this is no kick ass article
    The writer is lame, and when someone criticies him, the site removes the post.
    there is here a motherfucker operator, when ill put my hands on him, then we really going to kick some ass.

  • techbabu303

    Article Code seems like ASP
    Nice stuff but was wondering if the expressions can be wriiten in VB or C# instead of ASP kind of lingo.

    Did I miss the bus here ?

  • techbabu303

    Article Code seems like ASP
    Nice stuff but was wondering if the expressions can be wriiten in VB or C# instead of ASP kind of lingo.

    Did I miss the bus here ?

  • RSharma

    Hi Steve, I am very new to reporting services 2005 and need to create a report similar to what Jumping to another report
    Posted by: Elaine how do I do that how can I create links on the column to another report, I need to create a report with the counts of attendies in a conference and sessions in it and create a link on the counts that will pull the details of attendies.
    Thank you

  • emadmust

    Very Nice article
    this is very nice article, but i really not sure if we can use C# in expressions, unless we are using external assembly.
    the other issue I am facing is while trying to sum grouping data in footer,,, any advice will be handy. thanks and keep it up.

  • fkucuk

    good sample 😉
    By the way, I’ve just realized that the sample data contains the names of the Lost characters 😉

    Great Article!

  • Hell’O’Boss

    subreport problem ?
    Nice Article , Well i guess the subreport problem (Subreports within table/matrix cells are ignored) havent been addressed ?

    Any work around ?

    Thanks !

  • Hell’O’Boss

    subreport problem ?
    Nice Article , Well i guess the subreport problem (Subreports within table/matrix cells are ignored) havent been addressed ?

    Any work around ?

    Thanks !

  • buntyd

    thank you
    Very good article. saved my day

  • netian

    Can we have dynamic parameters
    I have a report in which i have a dropdown which contains all the customer names. Is it possible to use another dropdown to control the data for my customer dropdown.

    If i can have another dropdown that contains the customer type (Corporate and normal customers)
    If i select corporate customer from this dropdown then my second dropdown should display only corporate customers similarly if i select normal customers then it should only display normal customers.

    Any help highly appreciated,

    Mubashir Afroz.


    Combining expressions…
    Steve, very nice tutorial… However I’ve noticed two little things that you didn’t explain very well. Like when it comes to getting “Page 1 of 4″, you used 4 different textboxes. These can be combined like this:

    =”Page: ” & Globals!PageNumber & ” of ” & Globals!TotalPages

    into a single cell… Saves a lot of time!

    And by the way, the execution time is not how long it took to render the report but the time at which the report was launched.

    Very good article, nonetheless! Thanks!


    interactive sorting of sub report on main report

    Very nice article.
    I want interactive sorting of sub reports on main it possible? help me if possible.

    you can mail me on

  • Nagesh

    Hi Steve,
    Thanks, a very useful article, I just understood
    in two days about reporting services, the same ting has been explained in voluminus books where
    I should have spent lot of time to understand these basic and advance information of SSRS

    A highly worth reading article

  • Dineo

    I learned a lot from this exercise.I had lot of questions when I was doing books on line SSRS tutorials and thanks a lot because through this exercise I got the answers.I must say lot of stuff you touch, is not included on books on line tutorials(SQL Server Tutorials).

  • Ginters

    Great stuff
    Cheers dude. very helpful.

  • tinkureddy

    Nice Article. Really helpful

  • Cmatlage

    Very nice article…however, I do have a question. I have created my report in a collapsed mode as you talked about and I added the interactive sorts. What happens though is when I click on the sort, my report data collapses again, is there a way to keep the data view open after the sort?

  • dchillman

    use of Globals in external function call
    Well-written and informative article. In trying to extend your example I created an external assembly with a function that takes one argument, the report folder value;
    MyFunctions.GetRelativeUrl(string sReportFolder).
    In my development, if I hard-code a value and pass it to the function, the correct value is returned. However, I want to pass the Globals!ReportFolder to the function, which is where I am having problems. When I attempt that I receive an error which implies the value of Globals!ReportFolder is null. Do you know if there is a trick to using the Globals in an external function call?

  • pravinshah

    Great Steve
    Firt of all thanks for this article. Great way of explaiing the topics covered.

  • Bob11111

    Triple Sort Possible ???
    Thanks for writing such a nice article.

    Though I have a question, Is it possible to add double/triple sort in SSRS reports.

    Double sort comes in to play when two values in first column are same, then those two values will be sorted using 2nd column, and so on…

  • isha

    for refrenece
    dude , i need ur email can i get it for reference

  • Macekepp

    SSRS Parameter that give users options to insert values manual
    I have a report where I want my users to insert their choice of account No on my parameter called account #. Using a muilt-value with drop-down is a good as we have a big list of account numbers. So the better way will be to give them an option to insert their own choice of account N0s. Can I get some help of how to do it.


    Where A.acct_no in (@acct_no)


  • malltop1

    Useful advice
    Useful advice like this one have to be kept and maintained so I will put this one on my bookmark list! Thanks for this admirable column and acquisitive to column added of this blog here. <b><A HREF=””>coffee makers</a></b>

  • abattle

    Display Dynamic External Image in Table Cell

    I’m trying to display an external image in a report’s table based on a http url stored in a database table (i.e. http://<servername>/imageservice.svc/png/?image=999999999999). If I copy and paste the url into a web browser, the image displays appropriately. However, I receive a broken image and no error in the report.

    Thanks for your time & consideration.

  • budi bong

    set expanse/collapse drill down property
    Hi Steve,

    I’m trying to add drill down to my report, when I preview my report the drill down state is + by default. Can you show me how to set it state to be expand by default ?

    Thanks for your time & consideration

  • mayan

    marix sort rows by certain column values
    Thanks! This is a greate tutorial.
    I need help with sorting a matrix. I have a matrix with a row group of months and a column group of coutries, the data inside the matrix is the amount of sales. I want the matrix rows to be sorted by the decending value of a certain month (last month) column values.
    For example, if the report displays sept, oct, nov sales results by countries and Italy has has the highest amount of sales in last month (November) then the first row of the matrix should show Italy.
    Cannot figure how, maybe you could help?

  • mohammad umor

    SQL reporting
    Excelerate is a database driven application and a new reporting development framework dependent with in Excel. Some simple XML and SQL code you may be able to do rapidly create highly interactive <a href=”” target=”_blank”>sql reporting<a/a>, user forms, chart and so much by using Excelerate.