locked
Using a LINQ query to create a report using the ReportViewer object RRS feed

  • Question

  • I am using a LINQ query to join data from multiple tables to create an IEnumerable<ReportData> list.

    What is the correct order of operations to use the list I am generating as the data to import into my report?  Is there another route other than going from the IEnumerable to the report (does the data need to be first written to its own table somewhere?)

    Here are some things I have tried: converting the IEnumerable<ReportData> list into a datable (though I cannot get this to work within the dataset I added to my application) and trying to add a table to the data set I added to my application.

    This is what I would like to do: use a LINQ query in my DB service layer to create the IEnumerable list of instances of ReportData, which would contain all desired fields and values, and use each instance of "ReportData" as a row in a datatable.  However, any time I try to create a table, I am forced to either write a new SQL query (that is essentially the SQL version of my LINQ query) or copy in existing tables from my DB.  Is there a way to dynamically create a table using the LINQ query I have written that will create a table in the Dataset to be used in the report?

    • Edited by JSON_NJOY Wednesday, November 5, 2014 4:25 PM
    Tuesday, November 4, 2014 10:59 PM