SSRS - DataSource Instace not supplied for dataset1 dataset

Hello everybody

I have a 1st time developed SSRS in my WPF application.

but there are problems when viewing reports. It gives an error

DataSource Instace not supplied for dataset1 dataset

I took the following steps
1. ssrs development
2. create windowsFormHostControl in XAML
3. get a new report in code

4. reportviewer.processingmode = local
5. reportviewer.localreport.reportpath = "path"
6. install reportdatasource
7. add data source to reportviewer
8. update report
9. set windowsFormHost.child = reportviewer

What's bad about it??? please help me...

+4
source share
1 answer

This error means that you did not provide a data source with the same name that the report is expecting. if you look at RDL (or RDLC) in a text editor, there is a DataSources section, and there each data source has a name. In this case, it is called "dataset1".

How did you add ReportDataSource? If you do this at run time, you need to provide it with the same name that the report expects

reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dataset1", myDataSource));

Note the β€œdataset1” because the report associates this input with its internal dataset definitions.

+6
source

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


All Articles