Skip to Content
Former Member
Jul 10, 2008 at 06:41 PM

Binding CrystalReportViewer control to report published from BOE



I have gone through several sample application and seen two ways the binding has taken place...

one is getting the ReportClientDocument object throught the RASReportFactory as follows:

EnterpriseService tempService = enterpriseSession.GetService("", "RASReportFactory");

ReportAppFactory reportAppFactory = (ReportAppFactory)tempService.Interface;

ReportClientDocument reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID, 0);

CrystalReportViewer1.ReportSource = reportClientDocument ;

The other way I have come across is assigning the infoObject retrieved based on the query to the reportViewer control:

Report report = (Report)infoObject;

CrystalReportViewer1.EnterpriseLogon = enterpriseSession;

CrystalReportViewer1.ReportSource = report;

My question is:

How does the two binding ways different?

Is the second method not using the RASReportfactory to retrieve the report from BOE?

Which one is the best approach going forward?