问题
On my RDLC page, the "Report Data" window shows a custom dataset that it pulls fields from to display. I've modified this DataSet with some additional tables. However, these tables aren't shown and therefore I'm unable to select them for use in expressions (in the Expression window, under Datasets, there are only the tables that were originally there, not the additional tables I've added).
Refreshing the data source doesn't do anything, and if I right-click on it and select "New Dataset", I'm unable to select the parent data source (it doesn't appear in the drop down list). What I mean is, if the data source is called "MyDataSet", and under that are other DataSets, if I right-click and go to "Add Dataset", it brings up the dialog box but "MyDataSet" is not in the list of available Data sources, even though I'm specifically saying I want to add a datatable to that data source. The other, existing, datatables list it under the data source, but new ones do not.
How do I refresh the data source so I can access these new tables in my report?
回答1:
This is an old question, but I was having this problem too and I'll mention my answer for future googlers.
In the Report Data Window (which automatically appears for me when I am editing a .rdlc file), I had to Refresh my Dataset (same name as the DataSetName in the Tablix in my .rdlc Report), and then that updated the XML of the .rdlc file. The new fields are then available to me.
回答2:
I have the same problem with Visual Studio 2010 Premium. You must do this step:
- Re-build the project that contain your Business Object
- Restart Visual Studio
- Refresh your DataSet (Report Data --> Right click on DataSet --> Refresh).
回答3:
I managed to get this working (for SSRS in C# using a Dataset that points to a Stored Procedure) by:
- hitting Shift+Alt+D (which opens the "Data Sources" window)
- In Data Sources, select/click the table you want to update
- At the top of the window there are icons (I'm using VS2012). The 2nd from the right is "Configure Data Source" - click it and it will open a new wizard window that will appear to be refreshing everything.
- UN-check the column that is no longer applicable and/or check the new column (if the values aren't already checked/unchecked).
- Go back to your "Report Data" window (Ctrl+Alt+D) and right-click on your Dataset and then click "Refresh".
All the columns should be updated at that point.
回答4:
Have you tried rebuilding your project? I had to do this after changing any business object.
回答5:
I had this issue for hours on VS-2008. Tried everything and at the end what worked was just to close and open it VS again.
回答6:
I can confirm that just closing the solution and reopening it, with later refreshing the DataSet from Report Data window worked for me. Seems like there is no need to restart VS.
回答7:
Delete the dataset and again add it with ur query or usp...
回答8:
If you are using a database source the likely culprit is that you didn't create the query with select *. Without the * the query will always be static and new fields won't appear. HTH
回答9:
I got the same issue in visual studio 2012. I solved it, here is the steps,
- Press Ctrl + Q and type Report Data (If No Report Data window available)
- Expand Data Source node to find the data set (I have used Data Set)
- Right click on the Data set and select Refresh (Simply refresh the data source)
回答10:
For visual studio 2010
- Open Your Data Set (.xsd file)
- Right click on data set click on configure
- Click on Next Next than finish
- On your dataset click refresh than Changes willbe display.
回答11:
Sounds like same issue is happening on VS2019. I could resolve the issue by only restarting Visual Studio, nothing else worked!
回答12:
This is the only solution worked for me.
After updating the DataSource properly, open the .rdlc file in NotePad and add the newly added Field manually. Then it will be available to use in the report.
来源:https://stackoverflow.com/questions/4587103/rdlc-report-data-doesnt-update-to-reflect-changes