SSRS Dataset Field Refresh not updating for Tablix

2019-02-02 10:47发布

问题:

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.

回答1:

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



回答2:

You can also delete the .data file if you still can't get it to refresh.

  1. Go into the file folder where the .rdl file exists
  2. 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:

  1. In the Report Data windown, right click on you dataset and click Dataset Properties like so:

  1. Click Refresh Fields near the bottom right of the Dataset Properties window:



回答3:

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.



回答4:

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 :)



回答5:

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>


回答6:

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?



回答7:

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.



回答8:

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.



回答9:

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.



回答10:

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



回答11:

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.



回答12:

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.



回答13:

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.



回答14:

Clearing reportviewer's datasources works for me.

this.(reportviewername).LocalReport.DataSources.Clear();


回答15:

  1. Open the Visual Studio 2008 reports solution
  2. Open (double click) your report (.rpt file) on left pane
  3. Press Ctrl + Alt + D to open the Report Data panel
  4. Expand the DataSets folder
  5. Find the report's main data set and right click the "DataSet Properties" menu
  6. Click the "Refresh Fields" button on the popup window.