38

I have an rdlc that has a separately-defined dataset. The time has come that I have the need to add a column to one of the tables, which I can do without issue. However, when I open the rdlc to use the new column, it does not appear in the Report Data pane.

This issue was reported to Microsoft here, but it was closed as by design. The workaround offered with the issue does not seem to work for VS2010 (refresh the dataset or the table; neither does anything).

Has anyone seen this problem, and if so, how did you get around it?

Mark Avenius
  • 13,679
  • 6
  • 42
  • 50

8 Answers8

30

Well, I resolved my problem, but I don't like how I had to do it.

For reference, (as far as I can tell) the only way to add a column to a dataset that is already attached to an rdlc is to hand-edit the xml (i.e. open the rdlc with your favorite text editor and add a Field to the appropriate table). After doing this, the field appears in the Report Data pane, and I can use it as if it were there from the beginning.

I would still like to know how to perform this seemingly simple task from the UI, but nonetheless my current problem is solved.

Mark Avenius
  • 13,679
  • 6
  • 42
  • 50
  • 1
    FYI, I had the same issue and had to resolve in the same way you did. It would be nice if VS could be updated to allow us a better way to resolve this situation. – Del Lee Aug 11 '17 at 14:16
29

For those people who googled and got here, the Report Data panel is often hidden and can be found in the menu under View -> Report Data (Ctrl + Alt +D)... it's right at the bottom: http://www.codeease.com/about-update-dataset-for-a-rdlc-file-in-visual-studio-2010.html

Once that's up you can right click on the report data sets and refresh or edit them. This has always worked for me (once I remember and find the Report Data panel!), so I'm not sure why it didn't work for the OP.

Aranda
  • 855
  • 8
  • 17
  • 1
    This is what I was attempting to do, but the refresh was not making any difference. Thank you though! – Mark Avenius Jun 28 '13 at 14:23
  • 1
    Report data panel is not allowing to edit the Dataset (i.e, removing or adding fields into Dataset). Please provide more information how you did it? – afin Apr 01 '14 at 21:02
  • 1
    Right, the Report Data panel just lets you drag fields into the report. You first need to find the source DataSet, add the field there, then Right Click -> Refresh the dataset in the Report Data panel. You can also do properties on that dataset and it shows you the name of the Data source and dataset you need to add the column to. – Aranda Apr 02 '14 at 06:09
  • I had the same problem and this is what i was looking for. +1 – hajirazin Jul 07 '15 at 05:10
  • @Aranda you are missing the point. The "source" for the dataset is nowhere to be found, unless you edit the xml for the rdlc directly, which is ridiculous to have to resort to. – Del Lee Aug 08 '17 at 17:41
  • @DelLee where was this missing "source" ever reported as the point of the issue? The OP was not asking to change the source, just to get new columns to appear in the Report Data pane. – Aranda Aug 09 '17 at 01:37
  • @Aranda OP clearly states that refreshing the dataset or table does not solve his problem, so your solution to refresh the datasets is not on point. Further, he also clearly states that the new column does not appear on the report data pane - not that he cannot see the report data pane, which is the other part of what your "answer" attempts to address. Your subsequent comment about finding the "source" assumes the "source" can be found and modified, which it apparently cannot be other than editing the xml directly since no other workable answers have been posted. – Del Lee Aug 10 '17 at 13:49
  • @DelLee ok, you are right that my answer did not address the OP's actual issue. I was just trying to help, and for me the source dataset was always visible as an item in the solution explorer. Perhaps the OP's rdlc report dataset references the DB table directly, as opposed to using a DataSet file in the project. I also agree that it is ridiculous to have to edit the rdlc xml. – Aranda Aug 11 '17 at 04:05
7

Quick workaround I found for VS 13 users (not tested in other versions):

  1. Make the change you want in your class (add/remove/rename properties)
  2. Build the project
  3. Unload the report project
  4. Reload the report project
  5. Open the report rdlc file
  6. Make sure your Report Data window is visible, if not find it hidden at the bottom in the view menu
  7. Right click your data set and click 'Refresh', it will now work
disklosr
  • 1,536
  • 17
  • 26
  • what is meant by 'unload the report project'? – John M Mar 29 '16 at 03:48
  • in solution explorer right click on project that contains rdlc file and choose unload project. If your DataSet object is not in the same project as RDLC file then I think you need to unload that project too and reload it. – disklosr Mar 29 '16 at 09:42
  • This worked for me in VS 2022. – sunshine Aug 01 '22 at 18:49
1

This is for VS 2010.

Watch out for menu "Data" in Slandered menu.

Data --> Show Data Sources

You will get options to refresh the RDLC Data Source and all options related.

1

The easiest way I found is, if somebody out there is still looking for an answer, add a new Data Source (the xsd), on Report Data pane==>right click on Datasets ==>Add Dataset, the Dataset Properties dialog will appear. Create a new dataset, this time it will populate all the columns from table/stored proc. Once the dataset is added, exclude the old dataset, rename it to something else, through windows explorer or command prompt. Now exclude the newly added dataset, rename it to the old dataset name and include it back to the project. The data gets refreshed.

1

I'm using VS 2010.

On Solution Explorer

  1. Double click the .xsd file where your rdlc report is connected.
  2. Right Click > Configure
  3. Click Query Builder > Check/Select the fields you needed.
  4. Next > Next > Finish then Save.

On RDLC Report

  1. Press CTRL + ALT + D.
  2. On Report Data, right click DataSet then Refresh.
0

I am using VS 2008. THere's no View | Report Data in the menu. So, I hacked the RDLC file using NotePad. Some sections are binary, but some sections are xml. One of the xml sections lists the datafields. I just added one at the bottom of the list and changed the name and datatype as appropriate. I referenced the Dataset in my VS project so I got the right datatype and name. All works fine now.

  • Interesting, the View | Report Data seems to work fine for me. Make sure you currently have a .rdlc file open. – Aranda Apr 02 '14 at 06:10
-1

Open file rdlc in Visual Studio, then click View (in top menu) --> Data Report, in panel Data Report,right click into Data Sources/Report Dataset then click refresh.

Do Tu Tai
  • 1
  • 1