<?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>Purple Frog Systems &#187; Macro</title>
	<atom:link href="http://www.purplefrogsystems.com/blog/tag/macro/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.purplefrogsystems.com/blog</link>
	<description>Business Intelligence Consultancy</description>
	<lastBuildDate>Tue, 15 May 2012 11:49:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Clearing SSRS Query cache</title>
		<link>http://www.purplefrogsystems.com/blog/2010/04/clearing-ssrs-query-cache/</link>
		<comments>http://www.purplefrogsystems.com/blog/2010/04/clearing-ssrs-query-cache/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 08:32:23 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Macro]]></category>
		<category><![CDATA[Query Refresh]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.purplefrogsystems.com/blog/?p=100</guid>
		<description><![CDATA[When developing SQL Server Reporting Services (SSRS) reports, BIDS caches the query results when you preview the report. This cache is then used next time you run a preview. This has the benefit of speeding up report development, but it does cause a problem when you want to test changing data. A simple way of [...]]]></description>
			<content:encoded><![CDATA[<p>When developing SQL Server Reporting Services (SSRS) reports, BIDS caches the query results when you preview the report. This cache is then used next time you run a preview. This has the benefit of speeding up report development, but it does cause a problem when you want to test changing data.</p>
<p>A simple way of forcing the cache to refresh is to open the folder containing the .rdl report files, and delete the corresponding .rdl.data files. The next time you preview the report SSRS will be forced to requery the source.</p>
<p>To save time, I use the following macro to take care of it.</p>
<p>Press ALT+F8 to open the Macro Explorer, and add a new module called “RemoveRDLDataFiles” under MyMacros. Edit the file and add the following code to the file. (This is for SQL Server 2008, you may need to tweak the references for 2005).</p>
<pre>
<p class="code">
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
mports System.Diagnostics
Imports System.IO

Public Module RemoveRDLDataFiles

Sub RemoveRDLDataFiles()

        Dim project As Project
        Dim Folder As String

        project = DTE.ActiveSolutionProjects(0)

        Dim fi As New FileInfo(project.FullName.ToString)
        Folder = fi.DirectoryName

        For Each FileFound As String In Directory.GetFiles(Folder, "*.rdl.data")
            File.Delete(FileFound)
        Next

End Sub

End Module
</pre>
<p>You can then run it by either double clicking on the macro, or assigning a keyboard shortcut to it (via Tools, Customize, Keyboard).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purplefrogsystems.com/blog/2010/04/clearing-ssrs-query-cache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

