Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So far, in all the reports I have created I have just been using one element per report, so one table, or one matrix, one chart or one map. It is of course much more likely that we will want to create reports that combine multiple elements at the same time, and you can just do that, just add multiple elements to the same report and configure them the way you want them. But its often very useful, particularly when learning Reporting Services, that you don't want to try and create this massive report all at once; instead, it's more useful to configure the pieces individually and combine them later.
And one way to do this is using report parts. It's a simply idea: take an element of report like a matrix or a table and just save it by itself, without the rest of the report, without titles or footers, just the table, just the chart, just the matrix, and save it to the server. And if that report part is a data region it can be saved together with its data source and dataset embedded inside it. Okay, so how do we make one? Well, to start with, we do nothing different. We still create a regular report. We add and configure elements as we have been doing all along.
But then if we look at a part of that report and think, you know, I could use this table or this matrix or this chart again, and I don't want to have to re-add and reconfigure it, I make that a report part. So, I'm in a simple Report here. It's actually the first report I created with the very straightforward Customers Table here, and I want to create that as a report part. The only other thing that I have is a text box with an address. I might actually like to publish that is a report part so it's easy to reuse, so let's see how. Now you may have seen, when the jumping around Report Builder, that there is a Report Parts button on the Insert tab, but that's not what we want here.
That's how to use existing report parts, but none exist yet; instead the button we want is the very top-left one, the circular Office button. And that is an option to Publish Report Parts. You don't actually have to have anything selected on your report, as it will tell you which parts of this currently opened report you can publish. I click that button I get two options, to either publish everything in this report as a report part with the default setting or to review them before publishing. I'll always check the second option.
This scans the currently opened report and says, okay there is only one option here that I can publish as a report part; it's that Tablix or Tablix. Now this first point add to me that it might be useful to give this a slightly better name. If I mouse over a little Informational button here, down at the bottom it'll tell me that this report part will reference and embed a data source. And that's fine. If I wanted to extract the data source and dataset out, I could actually do that by coming to this section for datasets. I'm not going to; I am just going to leave it as the Default.
However, I am going to click the little triangle to expand it, because I can add a description of this report part, and that will make it easier to find the right one later. However, before I publish this, what I want to do is change the name of this from Tablix or Tablix1 to something better. I am going to just close this window, highlight the table, and grab the left corner, and then in the Properties window, find the Name section and change it from Tablix1 to Customer Table. But I had also said that I wanted to take this Address here and also publish that as a report part, so why didn't that appear? Well, it's because you can't just publish regular text boxes; something has to be either a data region--a matrix, a table, a chart, or a map--or a rectangle.
Rectangles can be published. So, if you want to publish, say, some text that's grouped together, put it in a rectangle first. So, I am going to grab the Rectangle option from the Insert tab, just draw it on my report, then grab my text field and drag it into the rectangle. And then if I move the rectangle around, it should contain the text field inside it. That looks about right. I'll just resize it a little bit, take it back to where it was originally. But now when I come back to my Publish Report Part options, click in the second option, I should have both options here. We have got Customer Table-- I need to put in my description there-- and this Rectangle 1 here, which I can type in Address Text, change the name of it that way.
Now below this, for both of these options, it's saying that it's going to publish them to the Report Server, which is where we've been publishing all our reports, but it's going to put them in a folder called Report Parts. If that folder doesn't exist, it will be created in just a second. So, I am going to go ahead and click Publish, and I get the message that 2 published successfully. Click Close. Now that's it. We have published a couple all the Report Parts, which we can now use in other reports. So, let's see how to add them.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98504 Viewers
61 Video lessons · 85797 Viewers
71 Video lessons · 69694 Viewers
56 Video lessons · 102009 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.