Refresh Fields in Dataset in ReportViewer

I have a WinForms application written in VS2012. It sends data from a view in my SQL Server database. I added a new column to my view, but cannot find a way to get the ReportViewer dataset to view the new column.

In the ReportData panel, I tried:

Right-click the data source and click Refresh. Right-click the dataset and click Refresh.

Both do not display the new column in the list of available columns.

How do I show a column in my report designer in VS2012?

+4
source share
7 answers

Since I had the same problem and none of the suggested answers helped ...

You can also add a field in XML. Right-click the report and select Open with... , select XML (Text)-Editor . Now find the <DataSets> and add a new <Field> to the <Fields> branch. For example, you simply added the Test column to your DataSet, which previously contained FieldName1 and FieldName2 . You can edit the XML as such:

 <DataSets> <DataSet Name="YourDataSet"> <Fields> <Field Name="FieldName1"> <DataField>FieldName1</DataField> <rd:TypeName>System.YourType</rd:TypeName> </Field> <Field Name="FieldName2"> <DataField>FieldName2</DataField> <rd:TypeName>System.YourType</rd:TypeName> </Field> <Field Name="Test"> <DataField>Test</DataField> <rd:TypeName>System.YourType</rd:TypeName> </Field> </Fields> </DataSet> </DataSets> 

Now save the XML and reopen it in the report designer. Now you can select a new field and add it to the report.

+4
source

In the "Report Data" window, do you see the "Datasets" section? Try updating these datasets. Also make sure the sources are mapped correctly and with the correct name.

+2
source

I usually delete the xsd file containing the data set and recreate it from scratch. You can then refresh the ReportData panel to see the new column.

+1
source

I ran into the same problem.

I managed to solve the following process: In your project, find the file ".xsd", which refers to all the Data used in the report (DataSource).

After discovering this aquivo in your resolution, open the constructor by double-clicking it.

This file is your data source, it can contain your queries, tables, procedures, search for your query related to the report that you want to update (DataSet) with one right-click, select "Configure ..." in the next resulting window, select request fields that should appear on the block forward, then just click on the finish.

Recall that this process was performed using storage procedures, and this has already been updated in my database.

+1
source

I'm not sure if this is on the right track, but I know that when using the .dbml constructor to connect to the database, when I change the object layout in the database, I need to update the server browser, the object on the design surface and add the object to the design surface again . It does not automatically update the schema in dbml.

0
source

1. Delete all contents and folder from your BIN project and Obj folder

  1. Reopen the visual studio and your project.

  2. Then press Ctrl + Alt + D to open the report data window.

  3. Data Source Extension Update Your Required

  4. Dataset extension Update desired

Now everything is all right. Good coding.

0
source

Go properties, re-select the source class

0
source

Source: https://habr.com/ru/post/1490631/


All Articles