cancel
Showing results for 
Search instead for 
Did you mean: 

How to use an Object Data Source in .NET 4.6?

Former Member
0 Kudos

Hello,

we are currently using an older version of Crystal Reports (2011) for use in an older application.

At the moment we are evaluating the 2016 version as we plan to use the reports in our new web api project, however we struggle to find important documentation in the trial.

We are planning to use Crystal Reports 2016 in an ASP.NET 4.6.2 Web API project in Visual Studio 2017 for generating PDF reports in the background and offering them as downloads through our API.

We want to build a report that uses an object graph created from various data sources and other APIs. For that we created a normal Object Data Source from the Visual Studio Data sources designer and are building this from our business logic layer.

However, we struggle to get this Object Data Source into the Crystal Report Designer in Visual Studio.

With DevExpress reports, this is as simple as following this tutorial: https://documentation.devexpress.com/XtraReports/17784/Creating-Reports-in-Visual-Studio/Detailed-Gu...

however, if possible we want to avoid changing the report engine to Devexpress as we have experience with Crystal Reports and would rather like to upgrade to the current version instead of exchanging our reporting technology alltogether.

Can you please show us how we would connect our object data source to the Report designer to use the properties of the objects as fields?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Sven,

CR for VS runtime is here, read all of the info on that page please.

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Go here for samples:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples

You don't need to use that third party tool for making a WEB app.

Create a new WEB site,

Select a CR report web app

Change the Page_Load to Page_Init and add these 3 lines:

CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rd.Load(@"c:\reports\formalas.rpt");
CrystalReportViewer1.ReportSource = rd;

Now run the web app and you should see a report.

Don

Answers (0)