Last Update: Sep 04, 2024 | Published: Sep 04, 2013
After you have completed your deployment of System Center Configuration Manager (SCCM), one of the simplest features to enable is that of the reporting server. In the latest versions of Configuration Manager 2012, this feature not only offers over 450 pre-created reports, but (far more importantly) it also provides a platform for creating your own custom reports – a feature that is overlooked in fear of the complexity that might be involved.
In this post, we will run through a quick demo of just how easy this really is to get working on your very own reports.
There are many different methods of creating reports, including the more sophisticated tools that Jennifer McCown introduced in her Introduction to SQL Reporting Services. However, for the sake and beauty of simplicity, I will introduce the SQL Report Builder, quickly show you how to install this tool, and more importantly point it to your Configuration Manager Reporting Server.
With the report builder now installed, launch the application. A dialog will popup presenting a progress bar while trying to connect to your report server. Ensure that you are logged in as a user with permissions to use and contribute to the report server, otherwise you will be presented with a “connection failed” message after a few moments. With a successful connection, the Getting Started page will be presented, offering you multiple options.
For this quick demonstration, we will begin with a new Blank Report, which will drop directly back into the report builder interface.
First we will create a connection for our new blank report with the data source we wish to use. For us this is simply going to be SCCM, and it will be even easier as the previously installed 450+ reports are all designed to use a single data source also, which of course is the SCCM databases!
To establish a connection for our report to the SCCM database, we just select the Data Source node in the Report Data tree, which by default is presented on the left pane of the window, and from the context menu choose the option Add Data Source.
With a connection now established to our SCCM database, leveraging the same connection used by the Microsoft provided reports, we next need to create a query for the data which we will use for the content of our report. The results of this query is referred to as the Data Set, or simply the set of data which will be used in the final report, at the time of execution.
These queries can range from the very simple to brain surgeon-level complex. If you are good with SQL queries this this will be a breeze; otherwise, use the community as there are literally thousands of great example queries posted all over the Internet.
To demonstrate I am going to use a moderately complex query which was posted by Shitanshu, a Microsoft SCCM guru. This query will calculate the Total Number of Clients on an SCCM Sites, organized by Active, Inactive and Obsolete, and calculating these is a % of the total. The SQL syntax is as follows:
select sub.AssignedSite, sum(sub.cnt ) 'Total Count', SUM(CASE SUB.ACTIVE0 when 1 then SUB.cnt END) AS 'Total Active Clients', SUM(CASE SUB.ACTIVE0 when 0 then SUB.cnt END) AS 'Total Inactive Clients', SUM(CASE SUB.obsolete0 when 1 then SUB.cnt END) AS 'Total Obsolete Clients' ,ROUND((CAST(SUM(CASE SUB.ACTIVE0 when 0 then SUB.cnt END) AS float) / SUM(sub.Cnt)) * 100,2) AS '% of Inactive Client Count' ,ROUND((CAST(SUM(CASE SUB.obsolete0 when 1 then SUB.cnt END) AS float) / SUM(sub.Cnt)) * 100,2) AS '% of Obsolete Client Count' FROM (select sit.sms_assigned_sites0 AssignedSite, sys.active0,sys.obsolete0 , COUNT(*) cnt from v_R_System sys join v_RA_System_SMSAssignedSites sit on sys.resourceID=sit.resourceID and (sys.Active0 is not null and sys.Obsolete0 is not null) group by sit.sms_assigned_sites0,sys.active0,sys.obsolete0 )sub group by sub.AssignedSite
To create the data set from this query, select the Dataset node in the Report Data tree, and from the context menu choose the option Add Dataset.
The new Dataset will be added to the Dataset node on the Report Data tree, expanded so that you can also see the names of each field which is included in the set.
Both the Source and Query are complete, we can finally proceed to creating our report. There are many options available to use at this point, ranging from a simple table style report to using indicators, gauges, charts, or even multiple tests. This is really where your creativity begins. For the purpose of this example, I will just show you how to create a simple table, but I urge you to get creative and try out all the different combinations you can imagine.
There you have it, your first report data all ready for the world to consume. As you can see the exercise itself is pretty simple, with the hardest part really getting the dataset query created.
There is no point in working through all the previous steps if you don’t save your new report to the report server ready for consumption, so let’s wrap up this exercise with the final steps needed to publish your work.
Finally, all that is left is to test your new report. Launch your web browser, surf to the URL of your report server, and browse to the location you just saved your report. Then click on the report name to launch it and enjoy your work!
Report creation is not as daunting as you might expect – the tools are rather easy to manage, and the hardest part is really the query. But you can, of course, take advantage of the many query building tools available to help with this process, or leverage as I did in this exercise the work of some great community contributors. In any case, I have just opened the door – please leave back some links and comments on the work you create, and add to community!