To open an unmanaged report

Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

To open an unmanaged report


 







Unmanaged reports can be opened from a file path accessible to the RAS server and stored as a ReportClientDocument object.

  1. Set the file path of the report you want to open.

NoteNote

The report must reside in a directory that the RAS server has access to.

Visual Basic

Dim path As Object = CType(reportPath, Object)

C#

object path = (object)sampleReportPath;

  1. Create a new ReportClientDocument object.

Visual Basic

Dim rcd As ReportClientDocument = New ReportClientDocumentClass()

C#

ReportClientDocument rcd = new ReportClientDocumentClass();

  1. Set the name and port of the RAS server used to open and process the report.

Visual Basic

rcd.ReportAppServer = "hostname:port"

C#

rcd.ReportAppServer = "hostname:port";

  1. Call the Open method of the ReportClientDocument class to open the report.

The second parameter accepts an integer value that specifies the open options. See the CdReportClientDocumentOpenOptionsEnum enumeration for details.

Visual Basic

rcd.Open(reportPathObject, CType(CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly, Integer))

C#

rcd.Open(ref reportPathObject, (int)CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly);

A ReportClientDocument object is created that represents the report, and can be modified using the controllers in this class.

The following code opens an unmanaged report called World Sales Report.rpt from a file path accessible to the RAS server.

Visual Basic

Private Function OpenSampleReport_unmanagedRAS(ByVal sampleReportPath As String) As ISCDReportClientDocument
 Dim rcd As ISCDReportClientDocument = New ReportClientDocumentClass()
 Dim path As Object = DirectCast(sampleReportPath, Object)
 rcd.ReportAppServer = "hostname:port"
 rcd.Open(path, CInt(CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly))
 Return rcd
End Function

C#

private ISCDReportClientDocument OpenSampleReport_unmanagedRAS(String sampleReportPath)
{
 ISCDReportClientDocument rcd = new ReportClientDocumentClass();
 object path = (object)sampleReportPath;
 rcd.ReportAppServer = "hostname:port";
 rcd.Open(ref path, (int)CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly);
  
 return rcd;
}

This list includes the namespaces used by the sample code:

© 2021 SAP AG. All rights reserved.

http://www.sap.com/sapbusinessobjects/

Support services

http://service.sap.com/bosap-support/

Created with the Personal Edition of HelpNDoc: Easily create Help documents