<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sqlserver007 &#187; SSRS</title>
	<atom:link href="http://www.sqlserver007.com/category/bi/ssrs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlserver007.com</link>
	<description>Blog on SQL SERVER and Business Intelligence  by Vivekanand Serou</description>
	<lastBuildDate>Fri, 21 May 2010 11:37:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Disable and Enable Subscriptions in Reporting Services</title>
		<link>http://www.sqlserver007.com/2010/05/21/disable_subscriptions_in_reporting-services/</link>
		<comments>http://www.sqlserver007.com/2010/05/21/disable_subscriptions_in_reporting-services/#comments</comments>
		<pubDate>Fri, 21 May 2010 11:37:58 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=520</guid>
		<description><![CDATA[Data Quality is very important and you want to make sure the business users get the Correct data from the Cube or from the Datawarehouses. In some circumstances where the data loads may fail you may want to disable the subscriptions so that the business users dont get the wrong reports. I use the following [...]]]></description>
			<content:encoded><![CDATA[<p>Data Quality is very important and you want to make sure the business users get the Correct data from the Cube or from the Datawarehouses. In some circumstances where the data loads may fail you may want to disable the subscriptions so that the business users dont get the wrong reports. I use the following script to disable the reporting services subscriptions</p>
<pre>
UPDATE J SET
	J.Enabled = 0
FROM sysjobs J
INNER JOIN syscategories C
ON J.category_id = C.category_id
WHERE C.[Name] = 'Report Server'
</pre>
<p>You can add the above script as a job step if the BI Load fails.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2010/05/21/disable_subscriptions_in_reporting-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running SQL Reporting Services Report from SSIS</title>
		<link>http://www.sqlserver007.com/2010/01/20/running-sql-reporting-services-report-from-ssis/</link>
		<comments>http://www.sqlserver007.com/2010/01/20/running-sql-reporting-services-report-from-ssis/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 10:35:03 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=496</guid>
		<description><![CDATA[Whenever you create a new Subscription in Sql server reporting services, a new job is created under the Sql agent as shown in the figure below. You can use the msdb.dbo.sp_start_job procedure to start the job. In SSIS create a new SQL task and run the job wherever required exec msdb.dbo.sp_start_job @job_name = 'JobName' For [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever you create a new Subscription in Sql server reporting services, a new job is created under the Sql agent as shown in the figure below.</p>
<p><a href="http://www.sqlserver007.com/wp-content/uploads/2010/01/Job1.jpg"><img src="http://www.sqlserver007.com/wp-content/uploads/2010/01/Job1.jpg" alt="" title="Job" width="291" height="60" class="aligncenter size-full wp-image-502" /></a></p>
<p> You can use the <strong>msdb.dbo.sp_start_job</strong> procedure to start the job.  In SSIS create a new SQL task and run the job wherever required</p>
<pre>exec msdb.dbo.sp_start_job @job_name = 'JobName'</pre>
<p>For more information about sp_start_job please refer <a href="http://msdn.microsoft.com/en-us/library/ms186757.aspx">MSDN</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2010/01/20/running-sql-reporting-services-report-from-ssis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reporting Services ToolTips</title>
		<link>http://www.sqlserver007.com/2009/12/18/reporting-services-tooltips/</link>
		<comments>http://www.sqlserver007.com/2009/12/18/reporting-services-tooltips/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 18:39:15 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=353</guid>
		<description><![CDATA[One good feature in SQL server Reporting Services is ToolTip . It is a simple feature but has more advantages if you want to show the complete information in a report. Its a great way of saving some Reporting space.I use it when Designing Dashboards or if you want add the redundant columns like the [...]]]></description>
			<content:encoded><![CDATA[<p>One good feature in SQL server Reporting Services is ToolTip . It is a simple feature but has more advantages if you want to show the complete information in a report. Its a great way of saving some Reporting space.I use it when Designing Dashboards or if you want add the redundant columns like the Description fields.</p>
<p>Here is an example from AdventureWorks. </p>
<p>SQL script</p>
<pre>
SELECT
	pp.ProductLine,
	pp.ProductNumber,
	pp.Name ,
        pp.Class ,
        pp.Color ,
        pp.FinishedGoodsFlag ,
        pp.ListPrice ,
        pp.Style ,
        pd.Description AS [Description] ,
        psc.Name AS SubCategoryName ,
        pc.Name AS CategoryName
        FROM    Production.ProductDescription pd
        JOIN Production.ProductModelProductDescriptionCulture pmpdc
				ON pd.ProductDescriptionID = pmpdc.ProductDescriptionID
        JOIN Production.Product pp ON pp.ProductModelID = pmpdc.ProductModelID
        JOIN Production.ProductSubcategory psc
				 ON psc.ProductSubcategoryID = pp.ProductSubcategoryID
        JOIN Production.ProductCategory pc
				 ON pc.ProductCategoryID = psc.ProductCategoryID
        WHERE pmpdc.CultureID = 'en'
ORDER BY pp.Name
</pre>
<p><strong>Report Layout<br />
</strong><br />
<img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/ReportingServicesLayout.jpg" alt="ReportingServicesLayout" title="ReportingServicesLayout" width="480" height="76" class="aligncenter size-full wp-image-355" /></p>
<p>I have not included the Category and SubCategory field in the above report . Instead I have included this as ToolTip</p>
<p>a. Right Click on the ProductNumber Text box<br />
b. TextBox Properties &#8211;> ToolTip</p>
<p><img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/ShowTooltip.jpg" alt="ShowTooltip" title="ShowTooltip" width="609" height="547" class="alignleft size-full wp-image-365" /></p>
<p>I added the following expression for Category and SubCategory</p>
<p><img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/CategoryExpression2.jpg" alt="CategoryExpression" title="CategoryExpression" width="467" height="96" class="aligncenter size-full wp-image-379" /></p>
<p>So when you hover over the ProductID, the end result is<br />
<br />
<img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/ShowCategories.jpg" alt="ShowCategories" title="ShowCategories" width="223" height="116" class="aligncenter size-full wp-image-369" /><br />
</p>
<p>You can do the same thing for large descriptive fields </p>
<p><img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/ShowDesc.jpg" alt="ShowDesc" title="ShowDesc" width="575" height="116" class="aligncenter size-full wp-image-370" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2009/12/18/reporting-services-tooltips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a simple FrontEnd using Reporting Services and Merge</title>
		<link>http://www.sqlserver007.com/2009/12/07/creating-reporting-services-as-frontend-using-merge/</link>
		<comments>http://www.sqlserver007.com/2009/12/07/creating-reporting-services-as-frontend-using-merge/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 23:03:53 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SSRS]]></category>
		<category><![CDATA[TSQL Development]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=321</guid>
		<description><![CDATA[Problem: A Business User wants to update/insert/delete the values in a table that sits in the metadata of the Datawarehouse on a regular basis. Based on these values numerous calculations will be done in the warehouse which generates a data driven Report on a weekly basis. Initially I got the following Solutions 1. Create a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem: </strong><br />
A Business User wants to update/insert/delete the values in a table that sits in the metadata of the Datawarehouse on a regular basis. Based on these values numerous calculations will be done in the warehouse which generates a data driven Report on a weekly basis.</p>
<p><strong>Initially I got the following Solutions</strong><br />
1. Create a frontend app for the user to populate the values (the most common Global solution)<br />
2. Ask the user to populate the values in an excel file with the columns in specific format so that I can use my SSIS to do the lookup with the original table and update/delete/insert based on the values.( But there are lot of things to consider when using excel like  Problems with incorrect format of excel files and maintaining them.)</p>
<p>So when I was reviewing the <a href="http://technet.microsoft.com/en-us/library/bb510625.aspx">Merge</a> feature in TSQL 2008, an idea stuck in mind</p>
<p>The solution I ended up doing was</p>
<p><strong>Creating a Reporting services Report that takes the values as parameter and use the MERGE statement to insert/update/delete the values in the backend table</strong></p>
<p><strong>Here is the Example of what I mean:</strong></p>
<pre>
create table CricketRuns
(
PlayerID int identity(1,1),
PlayerName nvarchar(max),
Runs int,
Average float
)
go

insert into CricketRuns
select 'Sachin Tendulkar',17000,45.23
union
select 'Ricky Ponting',12000,41.08
union
select 'Kevin Peiterson',4000,46.00
union
select 'Chris Gayle',7000,34.87
union
select 'Jacques Kallis',11000,42.09
union
select 'Ross Taylor',2500,41.00
go
 </pre>
<p>So the table looks like</p>
<p><img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/InitialResults1.jpg" alt="InitialResults" title="InitialResults" width="267" height="143" class="aligncenter size-full wp-image-325" /></p>
<p>I created this procedure using the Merge Statement that will insert / delete / update based on the players name</p>
<pre>
create procedure uspInsertRuns
	(
		@PlayerName nvarchar(max)
		,@Runs int
		,@Average float
		,@status nvarchar(100)
	)
		as
	Merge into CricketRuns as Target
	using
		(select @PlayerName,@Runs,@Average,@status) as source(Playername,runs,Average,Status)
	on
		(Target.Playername = source.PlayerName)
		when matched and Source.Status = 'D' then
		Delete
		when matched then
		update set runs = source.runs , Average = source.Average
		when not matched then
		insert (PlayerName,runs,Average)  values (source.PlayerName,source.runs,source.Average);

		select PlayerName,Runs,Average from CricketRuns order by PlayerID
 </pre>
<p>So you can insert,delete or update as below</p>
<p><strong>exec uspInsertRuns &#8216;Andrew Strauss&#8217;,2000,35,&#8221;  &#8211;> Insert<br />
exec uspInsertRuns &#8216;Virendar Shewag&#8217;,5000,37,&#8221; &#8211;> Insert<br />
exec uspInsertRuns &#8216;Ross Taylor&#8217;,0,0,&#8217;D&#8217; &#8211;> Delete<br />
exec uspInsertRuns &#8216;Sachin Tendulkar&#8217;,20000,45,&#8221; &#8211;> Update</strong></p>
<p>Just add the proc in a reporting services and expose it to the business user and thats it..A frontend using Reporting Services<br />
<img src="http://www.sqlserver007.com/wp-content/uploads/2009/12/ReportingServices.jpg" alt="ReportingServices" title="ReportingServices" width="643" height="456" class="aligncenter size-full wp-image-335" /></p>
<p>So without any excel management or creating a .net frontend  reporting services has done the job.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2009/12/07/creating-reporting-services-as-frontend-using-merge/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Checking TSQL in SQL Server Reporting Services Datasets</title>
		<link>http://www.sqlserver007.com/2009/10/13/checking-tsql-in-sql-server-reporting-services-datasets/</link>
		<comments>http://www.sqlserver007.com/2009/10/13/checking-tsql-in-sql-server-reporting-services-datasets/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:31:27 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[SSRS]]></category>
		<category><![CDATA[TSQL Development]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=278</guid>
		<description><![CDATA[Recently I have been checking all the Dependencies on the Reports in SSRS(Sql server Reporting Services) because of a Major deployment on the ETL. The ETL change was to accomodate the transfer of a few columns from old Table TableA to the new table TableB. Some of the Datasets in the Reports are Stored Procedures [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been checking all the Dependencies on the Reports in SSRS(Sql server Reporting Services) because of a Major deployment on the ETL. The ETL change was to accomodate the transfer of a few columns from old Table TableA to the new table TableB. Some of the Datasets in the Reports are Stored Procedures and so I used <a href="http://www.sqlserver007.com/2009/04/06/sql-server-views-dependencies/">sp_depends </a> procedure to get the list of dependencies for TableA.</p>
<p>I also used the following TSQL to get list of objects in any database where the command text includes TableA. </p>
<p><strong><br />
DECLARE @tablename VARCHAR(100)<br />
SET @tablename = &#8216;%tableA%&#8217;</p>
<p>SELECT OBJECT_NAME(id) AS OBJECT ,TEXT,*   FROM syscomments WHERE TEXT LIKE @Tablename<br />
</strong></p>
<p>So far its good. But I found there are some TSQL written directly in the Reports Datasets(which I think is bad SSRS Development) and I cannot search them using the above two procedures.<br />
Upon researching in the ReportServer database the TSQL that is stored in the datasets are embedded in the <strong>CommandText </strong>tag of <strong>content</strong>column in the <strong>Catalog </strong>table.</p>
<p>The following is the script that illustrates it.<br />
<strong>DECLARE @tablename VARCHAR(100)</p>
<p>SET @tablename = &#8216;%TableA%&#8217;</p>
<p>   SELECT  PATH<br />
           , NAME<br />
           , CAST(CAST(content AS VARBINARY(MAX)) AS XML) AS ReportXML<br />
   FROM ReportServer.dbo.Catalog<br />
   WHERE CAST(content AS VARBINARY(MAX))   LIKE @tablename<br />
</strong><br />
You can even update the reports using the ReportXML column which I will discuss about it the future blogs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2009/10/13/checking-tsql-in-sql-server-reporting-services-datasets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reporting Services Date Format</title>
		<link>http://www.sqlserver007.com/2009/09/17/reporting-services-date-format/</link>
		<comments>http://www.sqlserver007.com/2009/09/17/reporting-services-date-format/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 11:38:27 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SSRS]]></category>
		<category><![CDATA[DateTime]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/?p=234</guid>
		<description><![CDATA[Many Clients have varied Requirements for Dates. You can do the conversions in Date format using T-SQL from the following link in MSDN. In reporting services you can convert datetime using the customs visual basic datetime formats using Expressions. Here are the following links on MSDN for Visual Basic Datetime Formats Predefined DateTime Formats Using [...]]]></description>
			<content:encoded><![CDATA[<p>Many Clients have varied Requirements for Dates. You can do the conversions in Date format using T-SQL from the following link in <a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx">MSDN</a>.<br />
In reporting services you can convert datetime using the customs visual basic datetime formats using Expressions.<br />
Here are the following links on MSDN for Visual Basic Datetime Formats<br />
<a href="http://msdn.microsoft.com/en-us/library/362btx8f.aspx">Predefined DateTime Formats</a><br />
<a href="http://msdn.microsoft.com/en-us/library/59bz1f0h.aspx">Using Format Function</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2009/09/17/reporting-services-date-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Report Server Names for Instances</title>
		<link>http://www.sqlserver007.com/2009/09/08/report-server-names-for-instances/</link>
		<comments>http://www.sqlserver007.com/2009/09/08/report-server-names-for-instances/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 19:13:51 +0000</pubDate>
		<dc:creator>Vivek</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.sqlserver007.com/2009/09/08/reporting-server-names-for-instances/</guid>
		<description><![CDATA[If the sql server reporting services is configured on the server called &#8220;SQLBOX&#8221; then the URL is http://SQLbox/reports. If there is a named instance like SQLBOX\VIVEK then the reporting server URL is http://SQLBOX/reports_vivek]]></description>
			<content:encoded><![CDATA[<p>If the sql server reporting services is configured on the server called &#8220;SQLBOX&#8221; then the URL is  http://SQLbox/reports.<br />
If there is a named instance like SQLBOX\VIVEK then the reporting server URL is  http://SQLBOX/reports_vivek</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserver007.com/2009/09/08/report-server-names-for-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
