SSRS Document Map is gone after exporting report with cached reports - reporting-services

We are using Microsoft SQL Server Reporting Services Version 15.0.1102.932 and Microsoft Power BI Report Server Version 15.0.1108.153.
Some of our reports have a Document Map. When we export to Excel we don't want the Document Map. In the DocumentMapLabel we have logic like this:
=IIF(Globals!RenderFormat.Name = "EXCELOPENXML",Nothing,Fields!PAGR_ID.Value)
This works great. However, we have found an issue when the Caching is set to use a cache that expires in X minutes or always run from a history snapshot (option 2 or 3). After you export to Excel then run the report again for the same parameters, the document map is gone.
It appears when you export, the server fetches the data again so it can render it in the desired output format and creates a new record in the SnapshotData table in ReportServerTempDB. I queried that table before running a report for the first time. Ran the report, queried again and saw a new SnapshotData record, as expected. I ran the report several times and noticed the table field TransientRefcount was increasing with each run. Nice to know we can look at that and see how many times a cache has been accessed. I then exported to Excel, queried the table and noticed a new record was created. When I ran the report again with the same parameters I saw that new records TransientRefcount increase instead of the previous SnapshotData record.
Since our report turns off the document map when exporting to Excel, this new SnapshotData record doesn't have the document map in it. Now when you run the report again with the same parameters, the document map is gone, because the server is grabbing the most recent cached data.
Has anyone encountered this and found a way to fix it? A different way to turn off the document map?
I tried creating two tables, one with the document map and one without where the visibility of the table with the document map was set to hide if the RenderFormat is Excel and the other table hides when it's NOT Excel. But that didn't work, the cached version only displays the version without the document map. Which makes sense since the most recent cached version doesn't have a document map and it can't turn something on that isn't there.
One thought I had was to set the Globals!RenderFormat.Name to "RDL" when the report first runs before any parameters are entered, but I can't figure out how to do that. Maybe with some code? I've not used code in a report before so don't know how to do that.
Any thoughts? Thanks very much!

Related

How do I amend shared data source definitions after SSRS migration to a diff node?

Do not seem to be able to find any place in the portal or Report Builder where I can actually edit the connect string & creds.
Report Manager shows the XML, but that really is it.
Disk files (from the looks of it) are no longer present in high versions (using SQL 2016/2017).
Is there a known location anywhere in GUI, or maybe direct edits in the SQL Server repository?
I can't even delete a shared source anymore, only view or test the connection.
If anybody could post a screenshot, it'll be highly appreciated.
EDIT: Just found out - when I create a new Data Source, it's editable; the imported data sources are not.
There are two ways of doing this. You can set the 'overwrite datasource' option in the project properties.
Or, you can got to the report portal , show hidden items in the view menu and there is a folder called "data sources". Open this and you will see all data sources, from there you can edit and save changes. All reports that use that datasource will be affected.

SSRS showing old data in Report Server

We have 1 report that's being exported to PDF manually in the web page.
However, when we update a certain value, the new value can be seen in the table but when we tried exporting the data, it keep showing the old value in the report.
The stored procedure used in the report is showing the new value.
It works fine when running the VS 2013.
I am not sure if caching is enabled in our report server but in that RDL file, we did not explicitly specify to cached the data as shown below.
Processing Options Screenshot
Snapshot Options Screenshot
Parameter Settings Screenshot
There are no RDL.Data files in the report server as well and other reports are extracted to PDF and its working fine.
Do you have any idea or did I missed something that needs to be checked?
Thank you.

SSRS showing wrong data after deploying report

I am having this problem where the data being shown in report is different when I deploy it on server. So let's say if I am viewing report by pressing F5 (to debug) or by clicking on "Preview" button on the report in BI Studio the data shown is correct. But when I deploy the same report and when I run it from server such as http://myserver/reports then data shown is incorrect/missing.
For e.g. in some cases it is not showing data for a particular field and there are some number fields which are showing wrong data. I have cleaned the solution, deleted data cache files, rebuilt and deployed like 100 times but no luck.
When I deploy it shows some warning (which I guess I can ignore) but no errors.
I have checked the database by running queries and stored procedures directly and they all return correct data.
How do I fix this issue?
I went to report server and looked at the XML of one of the data set which was creating problem and found out that the new FIELD I have added is not there. Then I tried to deploy that data set and it said Overwrite Dataset property is set to False and that's why it was not deploying and I missed it in messages when it deploys a solution. So I simply set the property to True, deployed it and viola problem is solved.

SSRS Dataset Field Refresh not updating for Tablix

I have updated the SP for the attached dataset that the tablix is using. The refresh worked fine and I can see my new fields in the shared data set when I look in the Fields tab. My problem is the tablix itself is not giving me access to the new fields. There is a disconnect somewhere and I cannot figure out hot to get the tablix to see the updated fields available in the dataset. I run into this problem frequently and hope I can get a good answer here to return to in the future as I am sure I will need to. I have googled and looked through the suggested questions here and I cannot find one that is directly related to this issue.
I will also know note that the report project is in TFS source control as I read that has some adverse side affects. I have marked the whole project for edit and also went to the folder structure and made sure everything was unset to read only.
I am using SSRS 2008 in VS 2010.
Just found it... I don't understand the need for hidden menus like this..
Click the report itself, then go up to View on the menu and at the very bottom there is "Report Data". From here you can select your dataset and go to its properties and refresh the reports attached dataset's fields. What a pain in the butt.
Here is a link that helps better explain it.
http://blog.dontpaniclabs.com/post/2012/01/26/Developings-Reports-for-SQL-Server-Reporting-Services
You can also delete the .data file if you still can't get it to refresh.
Go into the file folder where the .rdl file exists
Next to it, there should be a file with the same name with the
.rdl.data extensions. Delete this file.
It appears to force the refresh probably because it has to recreate the file.
Here's a less invasive way but may not always work:
In the Report Data windown, right click on you dataset and click
Dataset Properties like so:
Click Refresh Fields near the bottom right of the Dataset Properties
window:
After changing the Stored Procedure code, without changing the name and number of fields returned, I could only get the report to seemingly call the new format of the stored procedure by clicking the Refresh button in the report's Preview tab.
Go into your solution folder, where the rdl's are stored and delete .rdl.data file for your report.
Next time you'll run the report, new rdl.data file will be created and it will have all the new fields from the updated SP.
ok, this maybe an older thread, but I kept running into the same problem on occasion. The absolutely easiest way to fix this is adding the following line of code to the beginning of the stored procedure that produces your dataset for the report:
SET FMTONLY OFF;
Happy coding :)
I ran into a very similar issue:
Added a new field to an existing SQL table function
(With some difficulty) added the new field to the existing dataset in SSRS
Spent some time unsuccessfully trying to add the new fields to the table (tablix?) in design mode.
This didn't work for me so eventually I opened the particular report file [filename].rdl in a text editor and surprise surprise it was XML. It was easy enough to add the missing field manually, and visual studio then prompted me to refresh the report.
<DataSets>
<DataSet Name="DataSet1">
...
<Fields>
<!-- add new field at this level -->
<Field Name="[newfield]">
<DataField>Email</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
I am having exact same issue in VS 2012. The stored procedure used as a query will not allow to refresh fields. When the button is pressed nothing happens.
The only solution I found is to flip the Query Type to Text and provide the parameter values on the exec call to the SP.
Why do we have to put up with these obvious show stopper bugs?
Had the same issue and I was able to resolve it by renaming my dataset in properties, creating a new dataset with the original name, and then hitting the refresh button.
Old thread, but I ran into this using VS 2015 and SSMS 2016. I was certain it was an issue with VS. When I went back to SSMS and tried executing my stored procedure, however, I found that passing certain parameter values would cause the query to fail. Interestingly, I was able to ALTER the stored procedure without encountering any errors. (Perhaps because some combinations of parameters wouldn't result in a failure?)
Anyways, at the end of the day it was faulty coding in my sproc that was causing the fields in SSRS not to refresh. When I went back and corrected the issues with my code, everything worked as expected in VS.
I am working in Visual Studio 2015 and none of the above answers worked for me. If you are getting the data from a stored procedure, you need to open the .xsd file and right click on the data model. Select Configure, and the correct values from the procedure should appear on the right of the window.
Then refresh your dataset from the Report Data tab.
I had the same issue.
I installed SP1 so that .rdl.data file would get generated which inturn also fixed the data refresh issue.
Reference: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e2b199df-bc1b-4211-9110-85a0c63454b8/why-does-ssrs-not-create-a-rdldata-file-when-previewing-a-report?forum=sqlreportingservices
I was trying to use an ODBC driver for the datasource that connected ok, but wouldn't show Fields in VS 2015 SSRS report. I went back and used a datasource based on SQL Server driver (it's in the choices when designing a datasource) and it worked perfectly.
I had this same issue but the cause was different from the other answers at the time of this writing.
In my case, the stored procedure used as the data source was returning multiple data sets (due to some debugging code that I had left in there).
SSRS was "seeing" the fields in the first dataset, whereas I was expecting it to see the fields in the second dataset.
Removing the extraneous datasets fixed the issue and SSRS was able to see the fields that I intended.
Clearing reportviewer's datasources works for me.
this.(reportviewername).LocalReport.DataSources.Clear();
Open the Visual Studio 2008 reports solution
Open (double click) your report (.rpt file) on left pane
Press Ctrl + Alt + D to open the Report Data panel
Expand the DataSets folder
Find the report's main data set and right click the "DataSet Properties" menu
Click the "Refresh Fields" button on the popup window.
Deleting .data no work for me. Deleting Dataset and adding again worked. And I had previously configured VS/SSRS to NOT cache.
refresh and deleting .data did not work for me. So I just manually added the fields.

SSRS different results in Data tab and Preview tab

I get the correct results (nov and dec data) when I run a query in the Data tab of a report that I built in SQL Server Reporting Services. When I preview the report I get old data from October. It doesn't make any sense to me. I'm not sure whats going on. Note: the data is in Oracle.
Here's the date filter I'm using
receipt_date + 2 <= SYSDATE
The query works fine in SQL Developer and in the Data tab in the .rdl designer in Visual Studio... just not in the Preview tab when I run the report... that's when I get Oct. data.
Anyone know what's going on here?
SSRS caches data locally for use by the designer. The cached data is only updated if the developer previews the report in VS.NET using a different set of parameters, which in your case never happens because the report has no parameters.
To allow SSRS to refresh the cached data, navigate to the directory which contains your design-time RDL file and delete any files which have the extension ".data".
This is way too late, but maybe this can help someone else in the future.
When developing SQL Reporting Services reports, a really annoying function is that preview data is cached locally when testing reports instead of fetched on every run. Even explicitly refreshing the data doesn't always fix this. The most reliable way to resolve this is to delete the .data file associated with your report RDL file. These data files are stored in the same folder with your report definitions.
While you can delete these files manually, the following 15 second configuration change to BIS makes the process of deleting all data caches as simple as a menu selection.
Let's see how to achieve this.
In Visual Studio -->
Go to Tools - External Tools...
Add a new tool with the following settings:
Now whenever you want to delete your report data cache, just go to Tools - Clear Report Data Cache.
The only thing that works for me (in 2008 R2) is deleting the .data file and rebuilding the report. The refresh button on the preview tab does nothing nor does editing the RSReportDesigner.config file (located in C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies). Very frustrating. If I change the query or sp logic I now have to manually delete the .data file in the report project directory in order to see the the most recent rendering of the data.
Hope this was fixed in SSRS 2012 data tools.
see the links
http://connect.microsoft.com/SQLServer/feedback/details/522670/ssrs-turn-off-local-data-cache-in-bids#
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/145ac9ac-b247-47d2-a787-98a8fcfad053
The link in Greg's post points to this workaround, added after Greg posted: http://blog.summitcloud.com/2010/05/disable-reporting-services-data-cache-in-development/ That explains which config file controls the data caching, and says that refreshing the preview may actually get you fresh data. (I'm running a long query now, so I don't know yet if that works.)
Try hitting the Refresh button on the Preview tab.
If I understand properly, that is the same issue I had with mine.
I could see the query run successfully in the Report Data window but whenever I ran the Preview of the report, I was getting no results.
I realised after a bit of mucking around, all I needed to do was hit the Refresh button (mini icons on the the Preview tab) to get the Preview refreshed with the new data.
Is there anything different regarding the dataset's parameters? Do report parameters feed the dataset at all? If so what are they?
Is the report a server report? If so what is the time set to on the server?
There are no report parameters.....the exact same sql is run everytime. I'm not sure what you mean when you ask if the report is a server report.
i have one theory that i haven't been able to test. this report is not deployed to Report Manager but is being run from Visual Studio. I don't know if that makes a difference.
Pressing the refresh button in BIDS VS2010 for me isn't working. Nor did deleting the cache file. My issue was that I didn't have a Row Group - so it was only showing one (old) record on the report.