0

I am working on WCF Rest Service With EnitityFrameWork .now I m bulding C# Winform Client, at client end I need to show some reports with result returning from WCF rest Service. Im new to Crystal Reports, I have Installed SAP Crystal reports with Visual Studio 2013. But I dont know how to work with this type of architecture? Please guide me how I can accomplished My Task Effciently, Thanks in Advance

kirtan
  • 289
  • 4
  • 13
Zaid Mirza
  • 3,540
  • 2
  • 24
  • 40

1 Answers1

0

As far as I know, the Crystal report runtime only works with Datasets/DataTables. So you need to take your result data from your rest service create a datatable and bind that to the report.

var iEnumerableFromWCFService = callYourWcfService();
DataTable dt = iEnumerableFromWCFService.ToDataTable<YourDataType>();
// or write your own method to createDataSetFromCollection(dataFromWcfService);
report.SetDataSource(dt);

Alternatively, you can get Crystal to get it's data directly from the database without your entity framework data.

Community
  • 1
  • 1
reckface
  • 5,678
  • 4
  • 36
  • 62
  • thats looks fine,please also guide me to how I can design reports with DB connection? how I can Start Designing Crystal reports in Visual Studio 2013,I have Installed SAP crystal Reports for 2013, Im nill in designing Crystal reports for client end. in Wcf Architecure – Zaid Mirza Feb 04 '16 at 14:08
  • The WCF aspect of your requirement is irrelevant. You need a way to export the dataset as xml or xsd: string filename="Schema.xml"; // Write the schema to the file. thisDataSet.WriteXmlSchema(filename);, then in the report wizard, point to this xml dataset to use as a datasource – reckface Feb 04 '16 at 15:21
  • My forms are ready they are doing CRUD by WCF. For reports I need to populate it from WCF, Wcf returns Custom DTO class. I there any way to convert DTO class to Dataset? so that I can Fill Report – Zaid Mirza Feb 04 '16 at 16:33
  • I have done by returing List from Service and setting report Source as list. It shows the data on report but only master object from list . it not showing detail objects. I follow example of link below http://www.codeproject.com/Tips/371018/Create-Crystal-Report-Document – Zaid Mirza Feb 06 '16 at 04:30