How to create DataSet from a LINQ query for Crystal Reporting

  • Thread starter Thread starter Russ Sherlock
  • Start date Start date
R

Russ Sherlock

Problem = StoredProcedure(n,n) -> An Entity -> Linq Query -> (Dataset ->
CrystalReport || DataGridView)

I can create an EntitySet from a parameterised StoreProcedure.
.... I query the the results using Linq (filter , sort etc)
.... I convert the results to a List<EntitySet> (DataGridView displays the
result)

*How* do I produce a DataSet from the query so that Crystal Reports can then
print it?
(The Cystal Report was designed using the Entity object.)

ItemsOnPremisesReport crystalRep = new ItemsOnPremisesReport();
using (DbaseEntities de = new DbaseEntities())
{
List<EntitySet> results = from item in
de.stockHeldForCust(3).AsEnumerable<EntitySet>()
select item;

// create DataSet from result...
// assign DataSet to CrystalReport
crystalRep.SetDataSource... =
crystalReportViewer1.ReportSource = crystalRep;
}

Russ
 
Back
Top