<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'sql', 'custom reports', and 'reporting services'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=sql,custom+reports,reporting+services&amp;orTags=0</link><description>Search results matching tags 'sql', 'custom reports', and 'reporting services'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>T-SQL Tuesday #005: Creating SSMS Custom Reports</title><link>http://sqlblog.com/blogs/michael_coles/archive/2010/04/12/t-sql-tuesday-005-creating-ssms-custom-reports.aspx</link><pubDate>Tue, 13 Apr 2010 00:14:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24228</guid><dc:creator>Mike C</dc:creator><description>&lt;P&gt;This is my&amp;nbsp;contribution to the T-SQL Tuesday blog party, started by &lt;A title="Adam Machanic" href="http://sqlblog.com/blogs/adam_machanic/archive/2010/04/05/t-sql-tuesday-005-reporting.aspx"&gt;Adam Machanic&lt;/A&gt; and &amp;nbsp;hosted this month by &lt;A title="Aaron Nelson" href="http://sqlvariant.com/wordpress/index.php/2010/04/t-sql-tuesday-005-reporting/"&gt;Aaron Nelson&lt;/A&gt;.&amp;nbsp; Aaron announced this month's topic is "reporting" so I figured I'd throw a blog up on a reporting topic I've been interested in for a while -- namely creating custom reports in SSMS.&lt;/P&gt;
&lt;P&gt;Creating SSMS custom reports isn't difficult, but&amp;nbsp;like most technical work it's very detailed with a lot of little steps involved.&amp;nbsp; So this post is a little longer than usual and includes a lot of screenshots.&amp;nbsp; There's also a downloadable &lt;A title="Sample SSMS Custom Reports" href="http://brprfa.bay.livefilestore.com/y1pu65YtRksdmF-NkqPRSNVJVjP75MjU31Yyvna97r9AoEdF9wilfgmWTFCpm7DDuuPRpS9qe9Io-h4_pms-Y2N0LV1L6j8bNeU/Custom%20Report%20Samples.zip?download"&gt;ZIP file&lt;/A&gt; with the projects from this article included.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;SSMS Custom Reports&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL Server 2008 and 2005 both offer custom report functionality in Management Studio.&amp;nbsp; With a little bit of work you can create custom SSMS reports just like the standard reports that Microsoft ships with Management Studio.&amp;nbsp; The Disk Usage Report shown below is just one of the many standard reports that comes with SSMS.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:591px;HEIGHT:496px;" title="SSMS Standard Report" alt="SSMS Standard Report" src="http://brprfa.bay.livefilestore.com/y1p96w-RdpK_UPoOGMgli4eVbzYi3Oj9d-SdGVX4zXdkABiCseQUqv8_Ye9DjYtHHdaJj39eOK0XzLEqnctlccDKSptvHhJME1c/standard-report.jpg" width=591 height=496&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Creating a Report Project&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SSMS uses the SQL Server Reporting Services (SSRS) 2005 client/viewer control to render both standard and custom reports.&amp;nbsp; This is true for both SSMS 2005 and SSMS 2008.&amp;nbsp; So the first step to building a custom SSMS report is to fire up Visual Studio 2005 and create a new &lt;EM&gt;Report Server Project&lt;/EM&gt; as shown below.&amp;nbsp; For this example we'll create a custom report that lists missing indexes, so give the project the name &lt;I&gt;Missing Index&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:550px;HEIGHT:305px;" title="Create New Project Dialog" alt="Create New Project Dialog" src="http://brprfa.bay.livefilestore.com/y1pkwKN2ypKEv3XJHROh7xaoTOi4R79ha01zyZnL-acBQhieH_6CAo18PEri6DjOBX5d_O2jgH6bPTvIOUWNpmr7eHf-4xxG_GI/vs2005-new-project.jpg" width=550 height=305&gt;&lt;/P&gt;
&lt;P&gt;Once you create the &lt;EM&gt;Report Server Project&lt;/EM&gt; right-click on &lt;I&gt;Reports&lt;/I&gt; in the Solution Explorer and choose &lt;I&gt;Add &amp;gt; New Item...&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:286px;HEIGHT:258px;" title="Add Report to Project" alt="Add Report to Project" src="http://brprfa.bay.livefilestore.com/y1p8qFbsxsFq7xjtkvppNWQ-N7S5R-uoHiJif6FtkChY1pzf5qQblwl7AapydMWrSRFY1_O-XsadEk5nR6XV9DX7-2lJVp7TFWn/add-report.jpg" width=286 height=258&gt;&lt;/P&gt;
&lt;P&gt;When the &lt;I&gt;Add New Item&lt;/I&gt; box appears, choose the Report template and give the report a name.&amp;nbsp;&amp;nbsp;For this example I named the report&amp;nbsp;&lt;I&gt;Missing Index.rdl&lt;/I&gt; - the &lt;EM&gt;.rdl&lt;/EM&gt; extension stands for "Report Definition Language", and is the standard extension for SSRS report definition files.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:551px;HEIGHT:244px;" title="Add Report Dialog" alt="Add Report Dialog" src="http://brprfa.bay.livefilestore.com/y1pf_VVyzWAjA0uiWHfEChyN-uwUNscnR9B5cHDipw1KDF1StNazv-T7xFtmGqtdgBVZ1kGS_daR5vqkPFk-QdqpWMVdDR5Nodv/add-report-box.jpg" width=551 height=244&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Defining the Report Dataset&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once the report is added to your project you have to add a new dataset to the report.&amp;nbsp; The dataset defines the structure and content of the source data that will populate your report.&amp;nbsp; Choose &lt;I&gt;&amp;lt;New Dataset...&amp;gt;&lt;/I&gt; from the &lt;I&gt;Dataset:&lt;/I&gt; dropdown.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:470px;HEIGHT:151px;" title="Add New Dataset dropdown" alt="Add New Dataset dropdown" src="http://brprfa.bay.livefilestore.com/y1pw8BZ2mr9F4SCExKCklLxVPczZu6Mq0IEo2agULy1QRoLJRF2KKDqVAv1Oft41oQu1oBaZd_iEMa91OfLT83Eeky87qAra11Z/add-new-dataset.jpg" width=470 height=151&gt;&lt;/P&gt;
&lt;P&gt;Visual Studio will respond with a &lt;EM&gt;Data Source&lt;/EM&gt; box.&amp;nbsp; Just make sure the &lt;I&gt;Type:&lt;/I&gt; dropdown is set to the default &lt;STRONG&gt;Microsoft SQL Server&lt;/STRONG&gt; and put &lt;STRONG&gt;Data Source=.&lt;/STRONG&gt; in the &lt;I&gt;Connection string:&lt;/I&gt; box.&amp;nbsp; This is all that's required since the SSMS custom report you're creating will use connections created and managed by SSMS's Object Explorer.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:569px;HEIGHT:487px;" title="Add Datasource Dialog" alt="Add Datasource Dialog" src="http://brprfa.bay.livefilestore.com/y1pZ9v1Nf3IVwj1bm5gCsMnZLstJyKbsLFI75DOGhsuGjcuHZalsEs2c_odVbbgaqiWQpwyYZkyRBc3BExbXiZweT67vn5FhBgN/add-data-source.jpg" width=569 height=487&gt;&lt;/P&gt;
&lt;P&gt;After you define the data source, you can define the SQL query that will populate your report.&amp;nbsp; Just put the query in the dataset window as shown below.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:703px;HEIGHT:358px;" title="Adding a Dataset" alt="Adding a Dataset" src="http://brprfa.bay.livefilestore.com/y1pfTvR7VFHggCKt2l8yVZ_2vlxY9-ZppnqW2MEJIDTQvzy1X7zhLg43LfaTKpRB2QI5rlzv_TcpiCKkbXPh7WQZL5d-a6PNLdP/add-new-dataset3.jpg" width=703 height=358&gt;&lt;/P&gt;
&lt;P&gt;I borrowed (and slightly modified) the following query from &lt;A title="Brent Ozar!" href="http://www.brentozar.com/"&gt;Brent Ozar&lt;/A&gt;.&amp;nbsp; He originally published it at &lt;A title=SQLServerPedia! href="http://sqlserverpedia.com/wiki/Find_Missing_Indexes"&gt;SQLServerPedia&lt;/A&gt;. &amp;nbsp;This particular query uses SQL Server's missing index Dynamic Management Views (DMVs) to identify missing indexes.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-- Begin missing index query&lt;BR&gt;&lt;BR&gt;WITH cte&lt;BR&gt;AS&lt;BR&gt;(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT mid.object_id AS object_id,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUOTENAME(OBJECT_SCHEMA_NAME(mid.object_id)) AS table_schema,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUOTENAME(OBJECT_NAME(mid.object_id)) AS table_name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUOTENAME('IX_' + OBJECT_SCHEMA_NAME(mid.object_id) + '_' +&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT(CAST(NEWID() AS CHAR(36)), 8)) AS index_name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid.index_handle&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM sys.dm_db_missing_index_details mid&lt;BR&gt;)&lt;BR&gt;SELECT&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DENSE_RANK() OVER&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER BY cte.table_schema, cte.table_name&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) AS table_color,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROW_NUMBER() OVER&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION BY cte.table_schema, cte.table_name&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY (avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) DESC&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) AS index_color,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cte.table_schema,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cte.table_name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cte.index_name AS index_name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) AS calc_impact,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'CREATE NONCLUSTERED INDEX ' + cte.index_name + ' ON ' +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cte.table_schema + '.' + cte.table_name +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' (' + COALESCE(mid.equality_columns, '') +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CASE WHEN mid.inequality_columns IS NULL&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN ''&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE CASE WHEN mid.equality_columns IS NULL&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN ''&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE ','&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END + mid.inequality_columns&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ') ' + CASE WHEN mid.included_columns IS NULL&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN ''&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE 'INCLUDE (' + mid.included_columns + ')'&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ';' AS create_stmt,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid.equality_columns,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid.inequality_columns,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid.included_columns &lt;BR&gt;FROM sys.dm_db_missing_index_group_stats AS migs &lt;BR&gt;INNER JOIN sys.dm_db_missing_index_groups AS mig&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON migs.group_handle = mig.index_group_handle &lt;BR&gt;INNER JOIN sys.dm_db_missing_index_details AS mid&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON mig.index_handle = mid.index_handle&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND mid.database_id = DB_ID() &lt;BR&gt;INNER JOIN cte&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON cte.index_handle = mid.index_handle&lt;BR&gt;WHERE migs.group_handle IN &lt;BR&gt;(&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT group_handle&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM sys.dm_db_missing_index_group_stats WITH (NOLOCK) &lt;BR&gt;)&lt;BR&gt;ORDER BY calc_impact DESC;&lt;BR&gt;&lt;BR&gt;-- End missing index query&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There are a couple of caveats to keep in mind about the missing index DMVs that this query relies on:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;They're not designed to be exhaustive.&amp;nbsp; If you want to get a serious analysis of useful indexes in your databases, you definitely want to use a tool that will perform a more extensive analysis.&lt;/LI&gt;
&lt;LI&gt;The DMVs only persist their information since the last time the SQL Server service was restarted.&amp;nbsp; If you've recently restarted the service you'll get very little information back.&amp;nbsp; These DMVs are best to use when your server has been running under normal load for a while.&lt;/LI&gt;
&lt;LI&gt;The suggestions returned by the DMVs aren't always the best way to go.&amp;nbsp; These DMVs often recommend suggested indexes with lots of overlap (lots of columns in common, often in similar order).&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;To put it another way, don't take the raw information returned by these DMVs at face value.&amp;nbsp; The information they return is definitely useful for determining where indexes might provide benefit if your system has been running under normal load for a while, and the redundant index suggestions tend to indicate which indexes might be most useful.&amp;nbsp; But these DMVs just amount to a starting point for analyzing your indexing needs.&amp;nbsp; I'd recommend against creating dozens of redundant&amp;nbsp;indexes based on the raw output of these DMVs.&lt;/P&gt;
&lt;P&gt;Visual Studio will normally populate the dataset fields.&amp;nbsp; If for some reason it doesn't, you can manually edit the fields by hitting the&amp;nbsp;&lt;IMG style="WIDTH:12px;HEIGHT:11px;" title="Edit Selected Dataset button" alt="Edit Selected Dataset button" src="http://brprfa.bay.livefilestore.com/y1p1RjlRPeT8nUiaHkby2NgdTPdwAZhlX8j1xno7j2uXjLVrCXDh4iCA3tat3aKVR2mak4Anfa_irdyFjJ8vd1qRUXFznVjXJLl/edit-selected-dataset.jpg" width=25 height=22&gt;&amp;nbsp;&lt;I&gt;Edit Selected Dataset&lt;/I&gt; button to pull up the &lt;I&gt;Dataset&lt;/I&gt; window.&amp;nbsp; You can then enter the field names on the &lt;I&gt;Fields&lt;/I&gt; tab if they aren't already populated.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:388px;HEIGHT:319px;" title="Edit Dataset Fields tab" alt="Edit Dataset Fields tab" src="http://brprfa.bay.livefilestore.com/y1pfvnIF4EbFtuA6q8rBYk0t072J_cDu43NCKGn3DGtJepbF5Xtr-qqAQ23gcmmMQr94DH295woheHjRbkSBuXMC-oHJsxPlDoL/dataset-fields.jpg" width=554 height=458&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Building the Report&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far most of what we've done is just setup.&amp;nbsp; With this&amp;nbsp;done, it's time to design and build the actual report.&amp;nbsp; For this, click on the Visual Studio &lt;EM&gt;Layout&lt;/EM&gt; tab to get to the report designer surface.&amp;nbsp; You can drag and drop text boxes, charts, tables, images and any other controls from the Toolbox onto the designer surface.&amp;nbsp; To keep it simple we'll just drag a text box and a table onto the designer.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:685px;HEIGHT:341px;" title="Reprot Designer Layout tab" alt="Reprot Designer Layout tab" src="http://brprfa.bay.livefilestore.com/y1pWNM-fc_9Nr_h6im9m8v9jweJclU9QXhuvkIMwSDMxkaDXMq_QqvgLUJN3wtzqqQil54T4aTHvvDOFPupnH2D_i0WQAhx9u2G/report-designer-1.jpg" width=685 height=341&gt;&lt;/P&gt;
&lt;P&gt;Put the title of the report in the text box (in this case "Missing Index Report") and format it to your liking.&amp;nbsp; The table we dragged onto the designer surface has three columns by default.&amp;nbsp; For this example we want six columns total.&amp;nbsp; To add more columns right-click on the top border of the table and choose &lt;I&gt;Insert Column to the Left&lt;/I&gt; to add a new column.&amp;nbsp; Repeat two more times.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:516px;HEIGHT:265px;" title="Inserting columns in SSRS table" alt="Inserting columns in SSRS table" src="http://brprfa.bay.livefilestore.com/y1pMVVRej-iyVngxatXV5eZNwxe42KRX3loOI5AMNbJYNPvaQLwNPdA2_rEfbFqaXJ1M827zxGteCq8wtIkw8mJmOigbBDgloik/insert-columns.jpg" width=831 height=459&gt;&lt;/P&gt;
&lt;P&gt;In the &lt;I&gt;Header&lt;/I&gt; row of the table we'll type in the headers for each column like the following:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:577px;HEIGHT:173px;" title="Editing Table Column Headers in a report" alt="Editing Table Column Headers in a report" src="http://brprfa.bay.livefilestore.com/y1pclRRkvyQ58kZth8uxowVdjARwR9LROwxTNmOxKph-la2SwSyk5UdkLqGTrgDQVNk1bi-Q4A9YX_8RUluiCHCba_EI6APPNOz/report-column-headers.jpg" width=968 height=303&gt;&lt;/P&gt;
&lt;P&gt;In the &lt;I&gt;Detail&lt;/I&gt; row we'll put in the formulas to populate the database fields like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:579px;HEIGHT:181px;" title="Editing the Report Table Details" alt="Editing the Report Table Details" src="http://brprfa.bay.livefilestore.com/y1pCcKPNTXmgXVchY8WkAtQYF-L5iPN8g65mJC8cHhd0fJ7O3tPx4iAHmhWO7XrQG8VXQ-c2p-pUE01v5noF_nqihOBBaQ9d15j/report-column-details.jpg" width=968 height=303&gt;&lt;/P&gt;
&lt;P&gt;SSRS formulas begin with the equal sign (&lt;STRONG&gt;=&lt;/STRONG&gt;).&amp;nbsp; Fields from the dataset are referenced directly using the format &lt;EM&gt;&lt;STRONG&gt;Fields!field_name.Value&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Deploying and Running the Report&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point use Visual Studio to build the project.&amp;nbsp; Once it builds without error, navigate to the project directory in Windows Explorer and copy the &lt;I&gt;Missing Index.rdl&lt;/I&gt; file to the SSMS Custom Reports directory (on my computer this directory is located at &lt;EM&gt;C:\Users\Michael\Documents\SQL Server Management Studio\Custom Reports&lt;/EM&gt;, it'll be different on yours).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;You can now bring up this report in SSMS by right-clicking on a database in the Object Explorer and selecting &lt;I&gt;Reports &amp;gt; Custom Reports...&lt;/I&gt; to select the custom report.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:350px;HEIGHT:322px;" title="Running a Custom Report in SSMS" alt="Running a Custom Report in SSMS" src="http://brprfa.bay.livefilestore.com/y1pXFRn1jsLwq2U9tpYrjStVVVnrG-A7RO2mZfEAd_tZPMUVN1X3VRrc81PtQl8l0TcHgCFIMa3dPDSb1qhAxRvyxu8vL94iaPB/run-custom-report.jpg" width=567 height=551&gt;&lt;/P&gt;
&lt;P&gt;Choose your custom report from the file selection box and click &lt;I&gt;Open&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:543px;HEIGHT:340px;" title="Selecting a Custom Report in SSMS" alt="Selecting a Custom Report in SSMS" src="http://brprfa.bay.livefilestore.com/y1pwUOidWktlB26rl2DefIcRZ4YzSDVRUwqZ3IqFDNh3mAEvNg9Fs-Gy8k8m5lnVJfSPm3dEb6GNQpOXGdsK2u1ABViZ4cHivzr/choose-custom-report.jpg" width=864 height=543&gt;&lt;/P&gt;
&lt;P&gt;When you run a custom report in SSMS you'll get a warning like the following:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:306px;HEIGHT:186px;" title="SSMS Custom Report Warning Box" alt="SSMS Custom Report Warning Box" src="http://brprfa.bay.livefilestore.com/y1pj7c9vCxvKz3cPrIDZuL5EIvxHJGN6FlCspgGan0cZdd08mvzz0CKuUbdxcfbKA-hPSJU4F9pP6BJb08s1vLqurCuKhYMWDHe/custom-report-warning.jpg" width=420 height=256&gt;&lt;/P&gt;
&lt;P&gt;Just choose &lt;EM&gt;Run&lt;/EM&gt;.&amp;nbsp; You might also want to check the box that says "&lt;EM&gt;Please don't show this warning again&lt;/EM&gt;" to keep the box from popping up every time you run a custom report.&amp;nbsp; The simple custom report you've created looks like the one shown below.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:593px;HEIGHT:254px;" title="Simple Custom Report" alt="Simple Custom Report" src="http://brprfa.bay.livefilestore.com/y1pTSsqYVoiCmzuzPOOHutMQnibG2CwxjGijBWma-J9VL3XPF1P0CpVzbQUUbGUj9vXmYh0avAt7armpL4BnSvxub7pcAq8xT3O/simple-report.jpg" width=964 height=453&gt;&lt;/P&gt;
&lt;P&gt;You can use images, color and other formatting techniques to make the report easier to read and use, and more flexible for your users.&amp;nbsp; Consider the image below, which is a screenshot of a reformatted version of the &lt;EM&gt;Missing Index&lt;/EM&gt; report.&amp;nbsp; This one includes more information, color and collapsible sections.&amp;nbsp; Both reports are included in the attached &lt;A title="SSMS Custom Reports" href="http://brprfa.bay.livefilestore.com/y1pu65YtRksdmF-NkqPRSNVJVjP75MjU31Yyvna97r9AoEdF9wilfgmWTFCpm7DDuuPRpS9qe9Io-h4_pms-Y2N0LV1L6j8bNeU/Custom%20Report%20Samples.zip?download"&gt;ZIP file&lt;/A&gt; under the Missing Index and Missing Index Color directories.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:601px;HEIGHT:488px;" title="Reformatted SSMS Custom Report" alt="Reformatted SSMS Custom Report" src="http://brprfa.bay.livefilestore.com/y1pHxjPdr2Zd4nKD0hsBC6T0BTOiIH15VmH6pfwHt3jfrod1z_bQ_dqEx6eDfZKCTt66KotLSPQXOOrX7F40Lwc3T05ZBCZGypG/final-report-color.jpg" width=991 height=810&gt;&lt;/P&gt;
&lt;P&gt;You can play around with the source files included in the attached &lt;A title="Sample SSMS Custom Reports" href="http://brprfa.bay.livefilestore.com/y1pu65YtRksdmF-NkqPRSNVJVjP75MjU31Yyvna97r9AoEdF9wilfgmWTFCpm7DDuuPRpS9qe9Io-h4_pms-Y2N0LV1L6j8bNeU/Custom%20Report%20Samples.zip?download" target=_blank&gt;ZIP file&lt;/A&gt;.&lt;/P&gt;</description></item></channel></rss>