Armand
Armand

Reputation: 10264

Single Object as datasource for report viewer

I am having some trouble with Report Viewer and RDLC files.

I have never before worked with any of these so I am still learning. I am looking for a guide to do the following.

I want to generate a report from a single object, ie. I have a list of objects and I want to pass say the first object to the report and then display the data contained in the properties of that object.

So basically I have a form which is completed and saved into my database, I have a custom object that stores the data captured in the form. I then want to click save and generate. This I then want to generate the report from the data captured on the page.

Any advise and guides would be appreciated.

I already have a xsd file generated from my object that I use as the dataset, I want to now supply the data.

Upvotes: 3

Views: 2563

Answers (1)

Gianni B.
Gianni B.

Reputation: 2731

It's very simple, but it's too long to write all the passages.

In short, you have to:

  1. Create your RDLC file from the report designer
  2. Bind your RDLC file with the DataSet you have
  3. (Option) Bind your report with the ReportViewer to show it on your webpage

The third passage is optional because you can also write code to render directly your report and put it in download as pdf file (or excel).

This blog's post explain a lot of passages so just have a look at it. There is also the famousgotreportviewer website but it's a bit outdated (still has good examples)

Upvotes: 1

Related Questions