<?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>SSRS &#8211; SQLpowered.com</title>
	<atom:link href="https://sqlpowered.com/tag/ssrs/feed/" rel="self" type="application/rss+xml" />
	<link>https://sqlpowered.com</link>
	<description>SQL Server + BI</description>
	<lastBuildDate>Tue, 28 Dec 2021 21:05:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://sqlpowered.com/wp-content/uploads/2020/07/FavIcon-e1594067873682-99x100.png</url>
	<title>SSRS &#8211; SQLpowered.com</title>
	<link>https://sqlpowered.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Extracting Metadata from the Power BI Report File</title>
		<link>https://sqlpowered.com/extracting-metadata-from-the-power-bi-report-file/</link>
					<comments>https://sqlpowered.com/extracting-metadata-from-the-power-bi-report-file/#comments</comments>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Sat, 19 Dec 2020 12:30:47 +0000</pubDate>
				<category><![CDATA[BI]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[SSRS]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?p=4795</guid>

					<description><![CDATA[The more and more is Power BI used everywhere it&#8217;s starting to be really painful to incorporate it in any metadata management solution. This article is a result of 10 hours investigation on how to get metadata from Power BI files. To be honest, a lot of workarounds, community tools,...]]></description>
										<content:encoded><![CDATA[
<p>The more and more is Power BI used everywhere it&#8217;s starting to be really painful to incorporate it in any metadata management solution. This article is a result of 10 hours investigation on how to get metadata from Power BI files. To be honest, a lot of workarounds, community tools, and nearly zero support by Microsoft. Correct me if I&#8217;m wrong.</p>



<p>The original requirement was to extract metadata from more than five hundred Power BI reports deployed in on-premises <a href="https://powerbi.microsoft.com/en-us/report-server/">Power BI Report Server</a>. It&#8217;s not an issue to download all these reports to the local folder via a custom tool (I will publish one soon) or using the <a href="https://docs.microsoft.com/en-us/sql/reporting-services/developer/rest-api?view=sql-server-ver15" target="_blank" rel="noopener">Report Server REST API</a>. But this API doesn&#8217;t expose metadata contained inside the Power BI report file (*.pbix). And opposite there is nothing directly inside the Power BI Desktop tool to export metadata in some human-readable or further processing suitable format. A little bit more (means not a full metadata-export solution) can be realized with the <a href="https://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">Power BI Cloud Service API</a> but this isn&#8217;t an option for on-premises running Power BI Report Server.</p>



<p>Let&#8217;s concentrate on the *.pbix file itself and keep the API option to another post.</p>



<p>If I&#8217;m talking about Power BI &#8220;metadata&#8221; I mean everything that is hidden inside the report: data sources, tables, columns, measures, relations, visuals used, etc. &#8220;External&#8221; metadata like where the report is sitting on the Report Server, how often it is used, and who can access it that&#8217;s easy to collect directly from the Report Server. But users, especially data analysts, DWH developers, and metadata solution specialists are more interested to see what is referenced from the DWH inside the Power BI report, how the whole data lineage looks like, how measures are calculated and relations used.</p>



<p>There basically two ways how to get this metadata:</p>



<ul class="wp-block-list">
<li>via opening the *.pbix file in Power BI and connecting to the underlying SSAS service hosting an instance of the Power BI model</li>
<li>extracting the *.pbix file content and processing various files (*.json) from it.</li>
</ul>



<p>I don&#8217;t want to describe the SSAS option there because we have realized this will require a significant amount of time to automate it somehow for hundreds of reports. It may also need dedicated hardware to process report changes in time. But still, it&#8217;s a valid solution and you can view more on it there:</p>



<ul class="wp-block-list">
<li><a href="https://www.biinsight.com/connect-to-power-bi-desktop-model-from-excel-and-ssms/" target="_blank" rel="noopener">Connect to Power BI Desktop Model from Excel and SSMS</a></li>
<li><a href="https://www.youtube.com/watch?v=rYlIp1PrBcA" target="_blank" rel="noopener">Document your Power BI model with DAX Studio</a></li>
</ul>



<h3 class="wp-block-heading">Power BI files (*.pbix, *.pbit)</h3>



<p>The *.pbix file is the main file of the Power BI report. It contains all metadata and also all data imported inside the model using the Import option for source queries. *.pbit is the Power BI Template file. It has in general the same content regarding metadata but it doesn&#8217;t contain any data imported from data sources like the *.pbix file. Both files are in fact *.zip files with other files packed inside. So rename them with *.zip extension and review the content.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" class="wp-image-4820" src="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01.png" alt="" width="697" height="190" srcset="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01.png 1476w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-300x82.png 300w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-1024x279.png 1024w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-150x41.png 150w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-768x209.png 768w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-360x98.png 360w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-160x44.png 160w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-320x87.png 320w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-520x142.png 520w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-720x196.png 720w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-980x267.png 980w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_01-1320x360.png 1320w" sizes="(max-width: 697px) 100vw, 697px" /></figure>



<p>It looks like that both files have the same content. But if you will review it twice there is a significant difference in how the DataModel is stored. Inside the *.pbix file is the model stored using Xpress9 compression to make the file much smaller because it contains data too. Inside the *.pbit template file it is an extracted DataModelShema in JSON format instead of it.</p>



<figure class="wp-block-image"><img decoding="async" class="wp-image-4822" src="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03.png" alt="" width="647" height="280" srcset="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03.png 1318w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-300x130.png 300w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-1024x443.png 1024w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-150x65.png 150w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-768x332.png 768w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-360x156.png 360w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-160x69.png 160w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-320x138.png 320w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-520x225.png 520w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-720x311.png 720w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-980x424.png 980w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_03-1156x500.png 1156w" sizes="(max-width: 647px) 100vw, 647px" /></figure>



<p>The Xpress9 compression is my point of view the main issue of why it&#8217;s so complicated to get the metadata from the Power BI. I did several attempts to extract the file playing with a lot of stuff from C++ libraries thru Python scripts, 7z, ending inside UWP Windows. Compression namespace but without success. All these tools can work with the original Express only compression algorithm which is a part of the Windows encryption API for a long time. But I really didn&#8217;t found anything to extract the new Xpress9 algorithm.</p>



<p>What does it mean? Simple answer: Without the ability to decompress the Xpress9 DataModel file only two options are in-game on how to get the Power BI metadata from the file:</p>



<ul class="wp-block-list">
<li>via connection to running Power BI SSAS instance (as described above)</li>
<li>or via the option to save Power BI Template in the Power BI Desktop application and processing the *.pbit file.</li>
</ul>



<p>Saving Power BI files as a template looks to be a simple solution at first look. But let&#8217;s go back to the initial requirement: process metadata for more than five hundred Power BI reports deployed to Report Server or even tens of files stored somewhere locally. There is no option to call Power BI from the command line to do this conversion in the background or something like that. It really means that every single Power bI report must be opened in Power BI Desktop and manually resaved as a Power BI Template file.</p>



<p>There is one solution in this <a href="https://www.youtube.com/watch?v=s3ivC07XKPc" target="_blank" rel="noopener">video</a>. We can use Power Automate Desktop to capture the manual conversion from *.pbix to *.pbit and then replay it automatically for other *.pbix file in the folder. This solution may be suitable for the initial conversion of multiple *.pbix files to templates but it may be hard to implement it on regular basis to the customer&#8217;s infrastructure. It&#8217;s still a workaround solution only.</p>



<h2 class="wp-block-heading">The *.pbit file content</h2>



<p>What is inside the Power BI Report file is pretty well described in this <a href="https://www.fourmoo.com/2017/05/02/what-makes-up-a-power-bi-desktop-pbix-file/" target="_blank" rel="noreferrer noopener">blog post</a>.</p>



<p>The DataMashup file, containing Query Editor metadata, may be extracted with 7z:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">7z x DataMashup -o".\DataMashupDir\" -aoa</pre>



<p><img decoding="async" class="alignnone  wp-image-4829" src="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04.png" alt="" width="359" height="315" srcset="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04.png 886w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-300x263.png 300w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-114x100.png 114w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-768x674.png 768w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-360x316.png 360w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-160x140.png 160w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-320x281.png 320w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-279x245.png 279w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-387x340.png 387w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-512x450.png 512w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-569x500.png 569w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_04-520x457.png 520w" sizes="(max-width: 359px) 100vw, 359px" /></p>



<p>It&#8217;s reporting some warnings but looks like all files are extracted properly:</p>
<p><img loading="lazy" decoding="async" class="alignnone  wp-image-4830" src="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05.png" alt="" width="270" height="79" srcset="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05.png 457w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05-300x88.png 300w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05-150x44.png 150w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05-360x106.png 360w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05-160x47.png 160w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_05-320x94.png 320w" sizes="auto, (max-width: 270px) 100vw, 270px" /></p>
<p>For working with the DataModelSchema JSON file inside the *.pbit file there is one great tool available: <a href="https://tabulareditor.com">https://tabulareditor.com</a>. You can use it to open the *.pbit file directly and review its metadata:</p>
<p><img loading="lazy" decoding="async" class="alignnone  wp-image-4831" src="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06.png" alt="" width="514" height="448" srcset="https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06.png 1331w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-300x262.png 300w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-1024x893.png 1024w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-115x100.png 115w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-768x670.png 768w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-360x314.png 360w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-160x140.png 160w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-320x279.png 320w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-281x245.png 281w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-390x340.png 390w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-516x450.png 516w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-573x500.png 573w, https://sqlpowered.com/wp-content/uploads/2020/12/Extract_Power_BI_Report_Metadata_Tabular_Editor_06-520x454.png 520w" sizes="auto, (max-width: 514px) 100vw, 514px" /></p>
<p>It&#8217;s doing a great job in parsing the DataModelSchema JSON and it is open source, so you can get inspired in the source a lot on what is inside the JSON.</p>
<p>For the live connection to the running Power BI model, <a href="https://daxstudio.org" target="_blank" rel="noopener">DAX Studio</a> is the ultimate solution.</p>
<h3>Conclusion</h3>
<p>Without the Xpress9 issue, it will be easy to have some simple solution to download *.pbix files from <em>dbo.Catalog</em> table in Report Server, convert it to ZIP, extract DataModel JSON schema, parse it, and upload it to metadata catalog. Conversion to *.pbit makes it cumbersome and workarounds are complicated.</p>



<p><strong>Further reading:</strong></p>



<ul class="wp-block-list">
<li><a href="https://cran.r-project.org/web/packages/pbixr/vignettes/explore.html" target="_blank" rel="noreferrer noopener">R library </a>to get Power BI metadata (using the SSAS connection solution but with interesting info about DataModel file)</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlpowered.com/extracting-metadata-from-the-power-bi-report-file/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Reporting Services 2017 &#8211; Kde najít licenční klíč?</title>
		<link>https://sqlpowered.com/reporting-services-2017-kde-najit-licencni-klic/</link>
					<comments>https://sqlpowered.com/reporting-services-2017-kde-najit-licencni-klic/#respond</comments>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Fri, 22 Jun 2018 15:39:43 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSRS]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?p=2696</guid>

					<description><![CDATA[V SQL Serveru 2017 již nejsou Reporting Services součástí standardní instalace jako jedna z volitelných položek, ale je třeba stáhnout&#160; jako samostatný instalační balíček. Při instalaci jsme potom vyzvání k volbě, zda chceme nainstalovat Developer/Evaluation edici nebo zadat licenční klíč pro instalaci do produkčního prostředí. Kde ovšem klíč najít? V...]]></description>
										<content:encoded><![CDATA[<p>V SQL Serveru 2017 již nejsou Reporting Services součástí standardní instalace jako jedna z volitelných položek, ale je třeba <a href="https://www.microsoft.com/en-us/download/details.aspx?id=55252">stáhnout&nbsp;</a> jako samostatný instalační balíček. Při instalaci jsme potom vyzvání k volbě, zda chceme nainstalovat Developer/Evaluation edici nebo zadat licenční klíč pro instalaci do produkčního prostředí. Kde ovšem klíč najít? V MSDN subscribci ho bude hledat marně, nejsou zde dokonce ke stažení ani SSRS, zatímco samotné SQL 2017 ano.</p>
<p><span id="more-2696"></span></p>
<p>Pokud jste se nedovtípili sami, stačí se podívat <a href="https://docs.microsoft.com/en-us/sql/reporting-services/install-windows/find-reporting-services-product-key-ssrs?view=sql-server-2017">sem</a>, abyste se dozvěděli, že stačí mít instalační médium SQL Serveru 2017 odpovídající licence, kde spustíte instalátor a zde zobrazený licenční klíč zkopírujete do dialogu pro zadání klíče v Reporting Services instalátoru.</p>
<p>Trošku záhada ovšem ještě může být, kde získat licenční klíč, pokud již máme na stroji, kde pouštíme instalátor SQL 2017, nějaké části SQL 2017 nainstalovány? Potom se nám totiž již nezobrazí okno s licenčním klíčem, ale rovnou další stránka instalátoru se stažením souborů setup.</p>
<p>Jde to opět jednoduše: Stačí jít do záložky Maintenance a zde zvolit Edition Upgrade. Hned první dialog pak obsahuje licenční klíč ke zkopírování:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2698" src="https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key.png" alt="" width="619" height="431" srcset="https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key.png 619w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-144x100.png 144w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-300x209.png 300w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-160x111.png 160w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-320x223.png 320w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-352x245.png 352w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-488x340.png 488w, https://sqlpowered.com/wp-content/uploads/2018/06/SSRS2017_Licencing_Key-520x362.png 520w" sizes="auto, (max-width: 619px) 100vw, 619px" /></p>
<p>Pozor je třeba dát, že tento postup neplatí pro Power BI Report Server. Jak získat správný licenční klíč je popsáno <a href="https://docs.microsoft.com/en-us/power-bi/report-server/find-product-key">zde</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlpowered.com/reporting-services-2017-kde-najit-licencni-klic/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Enable Remote Errors in Reporting Services</title>
		<link>https://sqlpowered.com/enable-remote-errors-in-reporting-services/</link>
					<comments>https://sqlpowered.com/enable-remote-errors-in-reporting-services/#respond</comments>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Sun, 17 Apr 2016 11:39:12 +0000</pubDate>
				<category><![CDATA[BI]]></category>
		<category><![CDATA[SSRS]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?p=1488</guid>

					<description><![CDATA[If there is an error during report data retrieval or rendering then a message is displayed saying an error has occurred and for more details we should navigate to report server or enable remote errors on it. This is not a very useful message but it is meaningful from the...]]></description>
										<content:encoded><![CDATA[<p>If there is an error during report data retrieval or rendering then a message is displayed saying an error has occurred and for more details we should navigate to report server or enable remote errors on it. This is not a very useful message but it is meaningful from the security point of view because the internal error message can contain sensitive information which should stay hidden from the end user. However, in the development or staging environment it can be time consuming to connect for every error with a remote desktop to report server machine and running report locally there. Moreover, observing report server logs is also uncomfortable. In this article we will see how to use SSMS to change report server configuration and enable remote errors to be forwarded to the client.<br />
<span id="more-1488"></span>In this picture we can see exactly how the error message looks like:</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-1492" src="https://sqlpowered.com/wp-content/uploads/2016/04/SSRS-Enable-Remote-Errors-1.png" alt="SSRS-Enable-Remote-Errors-1" width="760" height="41" /></p>
<p>Steps to change remote errors setting on Report Server using SQL Server management studio are as follows:</p>
<h4>1. Connect to Report Server from SSMS</h4>
<p>In SSMS click on the Connect button and select Reporting Services:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1491" src="https://sqlpowered.com/wp-content/uploads/2016/04/SSRS-Enable-Remote-Errors-2.png" alt="SSRS-Enable-Remote-Errors-2" width="218" height="159" /></p>
<p>A dialog with connection properties will appear as like if we are connecting to relational instance, but this time, fill in the name of the computer where our Report Server is installed.</p>
<h4>2. Change Report Server configuration</h4>
<p>Once you are connected to Report Server, go to the server node in Object Explorer and by right clicking open the menu and click on Properties:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1490" src="https://sqlpowered.com/wp-content/uploads/2016/04/SSRS-Enable-Remote-Errors-3.png" alt="SSRS-Enable-Remote-Errors-3" width="302" height="186" /></p>
<p>On the Server Properties screen search for a setting called &#8220;EnableRemoteErrors&#8221; and change the value from &#8220;False&#8221; (default) to &#8220;True&#8221; and press OK:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1489" src="https://sqlpowered.com/wp-content/uploads/2016/04/SSRS-Enable-Remote-Errors-4.png" alt="SSRS-Enable-Remote-Errors-4" width="707" height="634" /></p>
<p>This change is propagated to the Report Server immediately and if you go back to your report with error message and try again, a detailed error message is displayed instead of the generic one.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlpowered.com/enable-remote-errors-in-reporting-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Vytvoření datumové řady pro reporty s pohyblivou časovou osou</title>
		<link>https://sqlpowered.com/vytvoreni-datumove-rady-pro-reporty-s-pohyblivou-casovou-osou/</link>
					<comments>https://sqlpowered.com/vytvoreni-datumove-rady-pro-reporty-s-pohyblivou-casovou-osou/#respond</comments>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Sun, 03 Apr 2016 20:28:40 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSRS]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?p=1336</guid>

					<description><![CDATA[Pokud potřebujeme vytvořit report, který nám bude ukazovat například počet objednávek za posledních třicet dnů zpět, potřebujeme získat datový set, který bude obsahovat řádek pro každý den a k němu odpovídající počet objednávek. V následujícím tutoriálu si ukážeme jednoduchou implementaci pomocí rekurzivní definice tabulky  a také příklad použití výsledných dat...]]></description>
										<content:encoded><![CDATA[<p>Pokud potřebujeme vytvořit report, který nám bude ukazovat například počet objednávek za posledních třicet dnů zpět, potřebujeme získat datový set, který bude obsahovat řádek pro každý den a k němu odpovídající počet objednávek. V následujícím tutoriálu si ukážeme jednoduchou implementaci pomocí rekurzivní definice tabulky  a také příklad použití výsledných dat v grafu.<span id="more-1336"></span></p>
<p>Nejprve si vytvoříme testovací data. Tabulku dbo.Orders naplníme několika objednávkami, které mají OrderDate v uplynulých třiceti dnech:</p>
<pre class="lang:tsql decode:true ">CREATE TABLE [dbo].[Orders]
(
    [OrderId] INT IDENTITY(1,1) PRIMARY KEY,
    [OrderDate] DATE NOT NULL,
	[OrderDesc] NVARCHAR(100)
)
GO

INSERT INTO [dbo].[Orders]
        ( [OrderDate], [OrderDesc] )
	SELECT DATEADD(DAY, -25, GETDATE()), 'Order1' UNION ALL
	SELECT DATEADD(DAY, -25, GETDATE()), 'Order2' UNION ALL
	SELECT DATEADD(DAY, -23, GETDATE()), 'Order3' UNION ALL
	SELECT DATEADD(DAY, -23, GETDATE()), 'Order4' UNION ALL
	SELECT DATEADD(DAY, -23, GETDATE()), 'Order5' UNION ALL
	SELECT DATEADD(DAY, -10, GETDATE()), 'Order6' UNION ALL
	SELECT DATEADD(DAY, -10, GETDATE()), 'Order7' UNION ALL
	SELECT DATEADD(DAY, -5, GETDATE()), 'Order8' UNION ALL
	SELECT DATEADD(DAY, -5, GETDATE()), 'Order9' UNION ALL
	SELECT DATEADD(DAY, -2, GETDATE()), 'Order10'
GO</pre>
<p>Agregovaná data objednávek podle OrderDate vypadají takto:</p>
<pre class="lang:tsql decode:true">SELECT OrderDate, COUNT(*) NrOfOrders
FROM [dbo].[Orders]
GROUP BY [OrderDate]
GO</pre>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1338" src="https://sqlpowered.com/wp-content/uploads/2016/04/ValuesRangeForReportingCharts.png" alt="ValuesRangeForReportingCharts" width="175" height="114" /></p>
<p>Pro datový set použitelný v grafu však potřebujeme vygenerovat i dny, ve kterých nejsou žádné objednávky. Toho dosáhneme následujícím postupem:</p>
<pre class="lang:tsql decode:true">;WITH Dates AS
( 
	SELECT CAST(DATEADD(DAY, -30, GETDATE()) AS DATE) AS [DT] 
	UNION ALL
	SELECT DATEADD(DAY, 1, [DT]) AS [DT]
	FROM [Dates] 
	WHERE DT &lt;= CAST(GETDATE() AS DATE)
) 
SELECT 
	[DT], sc.[OrdersCount]
FROM Dates d
	OUTER APPLY (
			SELECT COUNT(*) OrdersCount
			FROM [dbo].[Orders]
			WHERE [OrderDate] = d.[DT]
	) sc
OPTION (MAXRECURSION 0)
GO</pre>
<p>Nejprve vytvoříme definici tabulky Dates a jako kotvu určíme datum, který je o 30 dnů menší než aktuální datum, získané pomocí funkce GETDATE(). Poté ke kotvě přidáme rekurzivní člen, který bude tabulku Dates procházet tak dlouho, dokud v ní nebude sloupec DT obsahovat datum, který se rovná datu dnešnímu. Z připravené Dates tabulky provedeme SELECT všech řádků a pomocí OUTER APPLY operátoru dohledáme počet objednávek pro každý datum. Získáváme tak datový set, který ve sloupci DT obsahuje datum pro každý z minulých třiceti dnů a ve sloupci OrderCount počet objednávek pro každý den, případně 0, pokud pro daný den žádné objednávky nejsou.</p>
<p>V Reporting Services datový set přiřadíme jako datový zdroj grafu následujícím způsobem:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1342" src="https://sqlpowered.com/wp-content/uploads/2016/04/ValuesRangeForReportingCharts3.png" alt="ValuesRangeForReportingCharts3" width="866" height="377" /></p>
<p>A výsledný graf může vypadat například takto (vertikální axis je třeba naformátovat pro &#8220;Days&#8221; formát vstupních dat):</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1341" src="https://sqlpowered.com/wp-content/uploads/2016/04/ValuesRangeForReportingCharts2.png" alt="ValuesRangeForReportingCharts2" width="620" height="243" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlpowered.com/vytvoreni-datumove-rady-pro-reporty-s-pohyblivou-casovou-osou/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
