简体   繁体   中英

Visual Studio 2013 - Creating Dataset for RDLC Report

I am trying to make a report. The class that I am working with has several ICollection properties, and passing those values to the report for display is difficult.

I have created a class called FlatClass that has all of the string values that I need to display. In the Controller, I plan to populate an array of type FlatClass and pass it to my Report. From what I have read, I need to create a custom dataset/data source. In Visual Studio 2013, when I click Add DataSet in the Report Data tab, it wants me to choose a table from my database. But ClassFlat does not have a table in the database.

I have added a .xsd file, but I cannot find any instruction on how to tell it the names and types of the Fields I want it to have.

Any help would be greatly appreciated!!!!

I tried to create rdlc report in my web application but I could not add my class as dataset. There was no option for that.

Workaround:

  1. Create a Library project in the same solution.
  2. Add the main project as reference to this new Library project.
  3. Create a rdlc file.
  4. Add dataset; for datasource select New->Object->Choose the class from you project namespace
  5. Do your report and when it is complete, move the file to the main project

Not sure if your problem is similar but hope the information is useful.

I ended up creating an .xsd file and just editing the raw XML to add all the properties of the class I wanted to use as a dataset. This worked when I added it to the report.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM