Click here to monitor SSC
  • Av rating:
  • Total votes: 619
  • Total comments: 107
Steve Joubert

Beginning SQL Server 2005 Reporting Services Part 2

20 September 2006

In Part 1 of this article, we looked at the basics of SQL Server Reporting Services 2005 (SSRS). We built one report with the Report Wizard, and one report using the Report Designer. In Part 2, we are going to look in more depth at the features that you can use everyday as an SSRS developer.

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 in the speech bubble to the right of the article title). 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.

Expressions

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:

=iif(Fields!State.Value = "CA", "Bold", "Normal")

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.

Note:
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:

=iif(Fields!State.Value = Parameters!HighlightState.Value, "Bold", "Normal")

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.

=Year(Fields!DateOfBirth.Value)

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:

Page
=Globals!PageNumber
of
=Globals!TotalPages

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:

Public Function GetColor(ByVal status as String) as String

IF status = "100" Then

Return "White"

End IF

IF status = "101" Then

Return "Yellow"

End IF

IF status = "102" Then

Return "Tomato"

End IF

End Function

Click OK and close the window.

Note:
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:

=code.GetColor(Fields!CustomerStatus.Value)

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..

Subreports

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:

SELECT CustomerID, FirstName, LastName FROM Customer

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:

SELECT Address, City, State, ZipCode

FROM Customer

WHERE (CustomerID = @CustomerID)

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.

Steve Joubert

Author profile:

Steve Joubert is a Microsoft Certified Professional in developing web applications in C#. He has spent nine years developing Microsoft technologies, including building .NET applications, and has a background in such diverse markets as pharmaceuticals, biotech, banking, finance and entertainment. He currently works for ASPSOFT in Orlando, Fla.

Search for other articles by Steve Joubert

Rate this article:   Avg rating: from a total of 619 votes.


Poor

OK

Good

Great

Must read
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Wednesday, September 20, 2006 at 4:02 PM
Message: thats a wonderful article Steve. very simple and to the point. it cleared many of my How-tos.
Thanks again

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Wednesday, September 20, 2006 at 10:01 PM
Message: Cool.. Easy to follow..

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Tuesday, September 26, 2006 at 4:27 AM
Message: 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.

Subject: Query
Posted by: Anonymous (not signed in)
Posted on: Wednesday, September 27, 2006 at 10:52 AM
Message: 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.

Subject: About Artical
Posted by: Anonymous (not signed in)
Posted on: Friday, September 29, 2006 at 1:27 AM
Message: its great artical for Beginner.

Subject: query
Posted by: Anonymous (not signed in)
Posted on: Friday, September 29, 2006 at 1:43 AM
Message: can you tell me how we can send the rdl report to printer through the vb.net 2005 code. i want to send the rdl report to printer with out preview the report.my email address is aliahmad2u@hotmail.com. if you find any result please share with me. waiting your kind response.

Subject: For Oracle Database
Posted by: Anonymous (not signed in)
Posted on: Friday, September 29, 2006 at 5:34 PM
Message: 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)

-Zavier

Subject: Quite Informative
Posted by: Anonymous (not signed in)
Posted on: Tuesday, October 03, 2006 at 3:14 AM
Message: Keep up the good job Steve!
Awaiting for Part 3 and Part 4

Subject: Thxs
Posted by: Anonymous (not signed in)
Posted on: Friday, October 06, 2006 at 3:53 AM
Message: Excellent!
We need more articles like this!!

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Sunday, October 08, 2006 at 5:29 PM
Message: I like it.
More advance please!

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Monday, October 09, 2006 at 3:52 PM
Message: Great article. Will there be any articles on how to set up reports programmatically?

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Monday, October 09, 2006 at 4:33 PM
Message: Great article. Will there be any articles on how to set up reports programmatically?

Subject: Where to.....
Posted by: Anonymous (not signed in)
Posted on: Wednesday, October 11, 2006 at 3:37 AM
Message: Cool. Steve

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Thursday, October 12, 2006 at 6:13 AM
Message: This article guide me to generate my first sub report. Thanks a lot Steve

Subject: Export to XLS
Posted by: Anonymous (not signed in)
Posted on: Thursday, October 12, 2006 at 7:11 PM
Message: 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

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Friday, October 13, 2006 at 8:19 AM
Message: I guess my search for 'SSRS How tos' stops here.Very good articles Steve.

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Saturday, October 14, 2006 at 3:10 AM
Message: Great!

Subject: Deploying
Posted by: Anonymous (not signed in)
Posted on: Monday, October 16, 2006 at 10:32 AM
Message: This is great article. But how do we deploy this project to the customer?

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Tuesday, October 24, 2006 at 6:35 PM
Message: This is good for beginer. But some advance level article will be very helpfull.

Subject: ssrs 2005
Posted by: Anonymous (not signed in)
Posted on: Wednesday, November 01, 2006 at 11:06 PM
Message: Thanx steve...great answer

Subject: SSRS
Posted by: Anonymous (not signed in)
Posted on: Monday, November 13, 2006 at 7:59 AM
Message: Good Article again Steve. Looking forward for your Part 4 and many more articles.


Subject: Fortunate to have Steve Joubert
Posted by: Anonymous (not signed in)
Posted on: Wednesday, November 15, 2006 at 8:56 PM
Message: 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
s_pemmasani@redsalsa.com

Subject: Beginning SQL Server 2005 Reporting
Posted by: Dayashankar (view profile)
Posted on: Friday, November 17, 2006 at 5:58 AM
Message: This is good Article.Some important and interesting feature is mentioned clearly.

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Tuesday, November 21, 2006 at 6:20 AM
Message: 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.

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Friday, November 24, 2006 at 12:43 AM
Message: Awesome man...

Subject: Beginning SQL Server 2005 Reporting
Posted by: Anonymous (not signed in)
Posted on: Wednesday, November 29, 2006 at 4:02 AM
Message: Really helpful for the beginners..
Keep it up.

Subject: Errr...
Posted by: Anonymous (not signed in)
Posted on: Tuesday, December 05, 2006 at 10:40 AM
Message: 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 ?

Subject: RS with Oracle Parameter
Posted by: Anonymous (not signed in)
Posted on: Monday, December 11, 2006 at 10:39 PM
Message: 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.

Example:

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

-Arif

Subject: Thanks alot
Posted by: Anonymous (not signed in)
Posted on: Wednesday, December 13, 2006 at 6:56 AM
Message: That was so helpful

Subject: Small Doubt
Posted by: Anonymous (not signed in)
Posted on: Wednesday, December 20, 2006 at 1:41 AM
Message: Can we get sub-report value in main report ?

Subject: ssrs
Posted by: Anonymous (not signed in)
Posted on: Wednesday, December 20, 2006 at 4:06 AM
Message: Its really good & helpful for begginners'.
Please send me SSRS related questions & answers to the following email id: sant_d2001@yahoo.co.uk



Subject: Beginning SQL Server 2005 Reporting
Posted by: charbel (view profile)
Posted on: Tuesday, December 26, 2006 at 4:37 AM
Message: great article and very helpful
10x a lot

Subject: SQl Server 2005 Reporting
Posted by: Navneet Trehan (not signed in)
Posted on: Thursday, January 04, 2007 at 5:20 AM
Message: Very good article. Thnx.

Subject: two charts in the same report
Posted by: Anonymous (not signed in)
Posted on: Tuesday, January 16, 2007 at 2:09 PM
Message: Steve,
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.

Subject: two charts in the same report
Posted by: Anonymous (not signed in)
Posted on: Tuesday, January 16, 2007 at 2:14 PM
Message: Steve,
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.

Subject: Custom Code
Posted by: Anonymous (not signed in)
Posted on: Tuesday, January 23, 2007 at 10:00 AM
Message: 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?
Thanks!

Subject: subreport out parameters?
Posted by: Anonymous (not signed in)
Posted on: Friday, February 09, 2007 at 6:19 AM
Message: 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.

Subject: Header and Footer In Sub Reports
Posted by: Anonymous (not signed in)
Posted on: Tuesday, February 13, 2007 at 3:01 AM
Message: How can we add the header and footer in subreports which are present in main report.
Plz reply me on abhishek.saini13@gmail.com

Subject: Good work
Posted by: Anonymous (not signed in)
Posted on: Tuesday, February 27, 2007 at 3:59 AM
Message: this is simple and excellent demonstration of SSRS.
for more information you may also conntace with me at mnadeem.abbasi@gmail.com

Subject: How about addinf footer to a Matrix ?
Posted by: Anonymous (not signed in)
Posted on: Sunday, March 04, 2007 at 3:49 PM
Message: Well, Columns are never the same (Dynamics) so how to add a summary footer ?

Subject: Good work.
Posted by: Anonymous (not signed in)
Posted on: Tuesday, March 20, 2007 at 1:59 AM
Message: Great articles. Keep it up. You ease the developer pain. Hooray!!

Subject: Very Good work
Posted by: Anonymous (not signed in)
Posted on: Tuesday, March 20, 2007 at 3:15 PM
Message: 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.


Subject: Good Work
Posted by: Anonymous (not signed in)
Posted on: Thursday, March 22, 2007 at 1:16 AM
Message: 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:
muthuselvi_84@yahoo.co.in
It's very urgent.Please help me.
Sorry for my english.

Subject: Great Work
Posted by: faceall (view profile)
Posted on: Monday, March 26, 2007 at 8:27 PM
Message: I like this article very much and it is very helpful for those who want to start working with sql reporting service.

Subject: Great Help
Posted by: Anonymous (not signed in)
Posted on: Wednesday, March 28, 2007 at 12:58 AM
Message: 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

Subject: Fantastic article
Posted by: Patrick Index (view profile)
Posted on: Friday, April 20, 2007 at 4:25 AM
Message: Thanks Steve for another cracker.

Subject: Great Help
Posted by: Anonymous (not signed in)
Posted on: Wednesday, May 09, 2007 at 5:00 AM
Message: Thanks Steve. I Like this Article,Its really good and helpful for beginners.

Subject: Please Help Me
Posted by: Anonymous (not signed in)
Posted on: Thursday, May 10, 2007 at 1:48 AM
Message: 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 vaishali.sapkal@praxistechnologies.net

Subject: Missing data from the Matrix
Posted by: Anonymous (not signed in)
Posted on: Friday, May 18, 2007 at 8:28 AM
Message: 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?

Subject: About Article
Posted by: Anonymous (not signed in)
Posted on: Saturday, May 19, 2007 at 4:45 AM
Message: 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

Subject: Great Article - More on Dynamic Drill Downs...
Posted by: Anonymous (not signed in)
Posted on: Friday, June 01, 2007 at 10:56 AM
Message: 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!

Subject: Header and Footer In Sub Reports
Posted by: Anonymous (not signed in)
Posted on: Monday, June 18, 2007 at 8:07 AM
Message: 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 rbalduc@tiscali.it )

Subject: Jumping to another report
Posted by: Elaine (not signed in)
Posted on: Thursday, June 28, 2007 at 5:35 AM
Message: 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 eibhling@gmail.com Thanks again.

Subject: About Atricle
Posted by: Venkateswarlu.Cherukuri (not signed in)
Posted on: Tuesday, July 03, 2007 at 6:54 AM
Message: 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.

Subject: About Atricle
Posted by: Venkateswarlu.Cherukuri (not signed in)
Posted on: Tuesday, July 03, 2007 at 6:55 AM
Message: 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.

Subject: how to do subreports in SSRS
Posted by: Karthik (not signed in)
Posted on: Friday, July 06, 2007 at 12:48 PM
Message: 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 karvallamp@gmail.com

Subject: Re: ssrs 2005
Posted by: Anonymous (not signed in)
Posted on: Thursday, July 12, 2007 at 9:17 AM
Message:

HI

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
vinnu_e@hotmail.com


Subject: how to do subreports in SSRS
Posted by: Anonymous (not signed in)
Posted on: Tuesday, July 17, 2007 at 11:54 PM
Message: 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 ashok25kumar@gmail.com

Subject: SQL Report Server Sort Problem
Posted by: Rajan (not signed in)
Posted on: Thursday, July 26, 2007 at 2:31 PM
Message: 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: rajandsa@hotmail.com

Subject: About Article
Posted by: Roger (view profile)
Posted on: Tuesday, July 31, 2007 at 4:56 AM
Message: An excellent article Steve. Many thanks for this quick start to SSRS.

Subject: adding a dropdown list to report
Posted by: godbolesagar@gmail.com (not signed in)
Posted on: Friday, August 03, 2007 at 4:20 AM
Message: hi
nice article !
how can we add a dropdown list to rdl report
thanks

Subject: Doubts!!!
Posted by: Muralidhar (not signed in)
Posted on: Tuesday, August 07, 2007 at 3:09 AM
Message: 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 mvm219@gmail.com

Subject: GOOD ONE
Posted by: Anonymous (not signed in)
Posted on: Thursday, August 16, 2007 at 12:27 PM
Message: really good one
it really helped a lort

Subject: Thanks
Posted by: Anonymous (not signed in)
Posted on: Thursday, August 16, 2007 at 12:51 PM
Message: Good article.

Subject: Thanks
Posted by: Anonymous (not signed in)
Posted on: Thursday, August 16, 2007 at 12:54 PM
Message: Good article.

Subject: Thank you!
Posted by: Anonymous (not signed in)
Posted on: Friday, August 17, 2007 at 11:39 AM
Message: A really helpful, clear walk-through. Now, to try my first solo report...

Subject: Question
Posted by: Wonderer (not signed in)
Posted on: Tuesday, August 21, 2007 at 11:08 AM
Message: 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.


Subject: too good !!!!
Posted by: Ajay (view profile)
Posted on: Monday, August 27, 2007 at 7:10 AM
Message: This is a very good article for all the beginers

Subject: how to handle duplicate records in ssrs
Posted by: Anonymous (not signed in)
Posted on: Tuesday, September 04, 2007 at 8:02 AM
Message: how to handle duplicate records in ssrs?
please reply to varanasi_narasimahamurthy@yahoo.com

Thanks and Regards,
Narasimha Murthy.V

Subject: Awesome, Very nice work
Posted by: Anonymous (not signed in)
Posted on: Thursday, September 06, 2007 at 8:40 PM
Message: 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 !!!

AB

Subject: Thanks!
Posted by: Anonymous (not signed in)
Posted on: Thursday, September 13, 2007 at 3:58 PM
Message: Quick & easy to understand!

Subject: custom datasource error
Posted by: Ganesh (view profile)
Posted on: Monday, September 17, 2007 at 1:55 AM
Message: hi

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

Subject: advanced my azz
Posted by: Anonymous (not signed in)
Posted on: Thursday, September 20, 2007 at 5:24 PM
Message: this article was far from "advanced techniques in ssrs". worthless.......

Subject: Thanks a Million
Posted by: Koketso Mashao (not signed in)
Posted on: Friday, October 05, 2007 at 4:48 AM
Message: This is a very very helpful exercise for beginners...Keep it up.

Regards,
Koketso Mashao
South Africa

Subject: SSRS Part2
Posted by: WallyG (view profile)
Posted on: Tuesday, October 16, 2007 at 3:13 PM
Message: 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.

Subject: I do appreciate this great tutorial!
Posted by: N Talwar (not signed in)
Posted on: Thursday, October 18, 2007 at 1:42 PM
Message: 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.
Thanks.

Subject: thanks for great work
Posted by: Anonymous (not signed in)
Posted on: Thursday, October 25, 2007 at 8:09 PM
Message: Great Article. I like every bit of it.
Thanks Steve

Subject: Anonymous Comments Disabled
Posted by: Sarah Grady (view profile)
Posted on: Wednesday, October 31, 2007 at 8:51 AM
Message: Due to a high volume of spam, anonymous comments have been disabled.

Subject: executiontime
Posted by: db042188 (view profile)
Posted on: Tuesday, November 20, 2007 at 5:00 PM
Message: 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.

Subject: rs2005 part2
Posted by: undershock (view profile)
Posted on: Thursday, November 29, 2007 at 5:52 AM
Message: 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.

Subject: this is no kick ass article
Posted by: kickass (view profile)
Posted on: Wednesday, December 12, 2007 at 1:50 AM
Message: 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.

Subject: Article Code seems like ASP
Posted by: techbabu303 (view profile)
Posted on: Friday, January 11, 2008 at 12:58 AM
Message: 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 ?

Subject: Article Code seems like ASP
Posted by: techbabu303 (view profile)
Posted on: Friday, January 11, 2008 at 3:58 AM
Message: 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 ?

Subject: Help
Posted by: RSharma (view profile)
Posted on: Thursday, March 27, 2008 at 10:17 AM
Message: 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

Subject: Very Nice article
Posted by: emadmust (view profile)
Posted on: Sunday, April 27, 2008 at 6:11 PM
Message: 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.

Subject: good sample ;)
Posted by: fkucuk (view profile)
Posted on: Friday, May 30, 2008 at 2:12 AM
Message: By the way, I've just realized that the sample data contains the names of the Lost characters ;)
Nice.

Great Article!

Subject: subreport problem ?
Posted by: Hell'O'Boss (view profile)
Posted on: Thursday, June 12, 2008 at 1:41 AM
Message: Nice Article , Well i guess the subreport problem (Subreports within table/matrix cells are ignored) havent been addressed ?

Any work around ?

Thanks !

Subject: subreport problem ?
Posted by: Hell'O'Boss (view profile)
Posted on: Thursday, June 12, 2008 at 5:19 AM
Message: Nice Article , Well i guess the subreport problem (Subreports within table/matrix cells are ignored) havent been addressed ?

Any work around ?

Thanks !

Subject: thank you
Posted by: buntyd (view profile)
Posted on: Tuesday, July 01, 2008 at 10:17 AM
Message: Very good article. saved my day

Subject: Can we have dynamic parameters
Posted by: netian (view profile)
Posted on: Wednesday, July 23, 2008 at 6:35 AM
Message: Hello,
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,

Regards,
Mubashir Afroz.
==================

Subject: Combining expressions...
Posted by: GLXSOLUTIONS (view profile)
Posted on: Thursday, August 21, 2008 at 1:38 PM
Message: 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!

Subject: interactive sorting of sub report on main report
Posted by: jitu123sali@yahoo.co.in (view profile)
Posted on: Wednesday, September 10, 2008 at 11:49 PM
Message: Hi,

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

Thanks
you can mail me on jitu123sali@gmail.com

Subject: SSRS
Posted by: Nagesh (view profile)
Posted on: Thursday, September 18, 2008 at 6:21 PM
Message: 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
Thanks
itjmn@yahoo.com

Subject: SSRS
Posted by: Dineo (view profile)
Posted on: Thursday, October 02, 2008 at 2:55 AM
Message: 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).

Subject: Great stuff
Posted by: Ginters (view profile)
Posted on: Wednesday, January 07, 2009 at 11:03 AM
Message: Cheers dude. very helpful.

Subject: SSRS
Posted by: tinkureddy (view profile)
Posted on: Sunday, March 29, 2009 at 12:27 PM
Message: Nice Article. Really helpful

Subject: Question
Posted by: Cmatlage (view profile)
Posted on: Wednesday, April 01, 2009 at 10:53 AM
Message: 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?

Subject: use of Globals in external function call
Posted by: dchillman (view profile)
Posted on: Saturday, June 06, 2009 at 9:46 AM
Message: 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?

Subject: Great Steve
Posted by: pravinshah (view profile)
Posted on: Tuesday, August 11, 2009 at 12:42 AM
Message: Firt of all thanks for this article. Great way of explaiing the topics covered.

Subject: Triple Sort Possible ???
Posted by: Bob11111 (view profile)
Posted on: Friday, July 09, 2010 at 6:55 AM
Message: 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...


Subject: for refrenece
Posted by: isha (view profile)
Posted on: Thursday, July 15, 2010 at 2:39 AM
Message: dude , i need ur email can i get it for reference
plz...

Subject: SSRS Parameter that give users options to insert values manual
Posted by: Macekepp (view profile)
Posted on: Wednesday, October 20, 2010 at 2:40 AM
Message: 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.

[/quote]

Where A.acct_no in (@acct_no)

[quote]

Subject: Useful advice
Posted by: malltop1 (view profile)
Posted on: Friday, November 26, 2010 at 4:02 AM
Message: 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="http://www.coffee-world.us">coffee makers</a></b>

Subject: Display Dynamic External Image in Table Cell
Posted by: abattle (view profile)
Posted on: Monday, February 07, 2011 at 6:10 AM
Message: Steve,

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.

Subject: set expanse/collapse drill down property
Posted by: budi bong (view profile)
Posted on: Wednesday, December 14, 2011 at 11:51 PM
Message: 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

Subject: marix sort rows by certain column values
Posted by: mayan (view profile)
Posted on: Sunday, January 15, 2012 at 2:42 AM
Message: 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?

Subject: SQL reporting
Posted by: mohammad umor (view profile)
Posted on: Friday, June 29, 2012 at 1:04 PM
Message: 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="http://www.biztechadvisors.com/" target="_blank">sql reporting<a/a>, user forms, chart and so much by using Excelerate.

 

Phil Factor
Searching for Strings in SQL Server Databases

Sometimes, you just want to do a search in a SQL Server database as if you were using a search engine like Google.... Read more...

 View the blog

Top Rated

SQL Server XML Questions You Were Too Shy To Ask
 Sometimes, XML seems a bewildering convention that offers solutions to problems that the average... Read more...

Continuous Delivery and the Database
 Continuous Delivery is fairly generally understood to be an effective way of tackling the problems of... Read more...

The SQL Server Sqlio Utility
 If, before deployment, you need to push the limits of your disk subsystem in order to determine whether... Read more...

The PoSh DBA - Reading and Filtering Errors
 DBAs regularly need to keep an eye on the error logs of all their SQL Servers, and the event logs of... Read more...

MySQL Compare: The Manual That Time Forgot, Part 1
 Although SQL Compare, for SQL Server, is one of Red Gate's best-known products, there are also 'sister'... Read more...

Most Viewed

Beginning SQL Server 2005 Reporting Services Part 1
 Steve Joubert begins an in-depth tour of SQL Server 2005 Reporting Services with a step-by-step guide... Read more...

Ten Common Database Design Mistakes
 If database design is done right, then the development, deployment and subsequent performance in... Read more...

SQL Server Index Basics
 Given the fundamental importance of indexes in databases, it always comes as a surprise how often the... Read more...

Reading and Writing Files in SQL Server using T-SQL
 SQL Server provides several "standard" techniques by which to read and write to files but, just... Read more...

Concatenating Row Values in Transact-SQL
 It is an interesting problem in Transact SQL, for which there are a number of solutions and... Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.