To create a new unmanaged report

Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

To create a new unmanaged report

See Also 

 







New, unmanaged reports on a file path accessible to a RAS server can be created using the ReportClientDocument.New method.

NoteNote

Do not use the ReportAppFactory.NewDocument method, which is reserved for creating new, managed reports in a SAP BusinessObjects Enterprise repository.

  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 New method of the ReportClientDocument class to create a new, blank report.

Visual Basic

rcd.New()

C#

rcd.New();

  1. Save your new, blank report to a folder accessible to the RAS server and close the report .

Visual Basic

Dim reportDirectory As String = "C:\"
Dim reportDir As Object = DirectCast(reportDirectory, Object)
rcd.SaveAs("MyNewUnmanagedReport.rpt", reportDir, CInt(CdReportClientDocumentSaveAsOptionsEnum.cdReportClientDocumentSaveAsOverwriteExisting))
rcd.Close()

C#

string reportDirectory = "C:\\";
object reportDir = (object)reportDirectory;
rcd.SaveAs("MyNewUnmanagedReport.rpt", ref reportDir, (int)CdReportClientDocumentSaveAsOptionsEnum.cdReportClientDocumentSaveAsOverwriteExisting);
rcd.Close();

The following code creates a new, blank, unmanaged report called MyNewReport.rpt in a folder located at C:\MyReports\.

Visual Basic

Private Sub CreateNewUnmanagedReport()
 Dim rcd As ISCDReportClientDocument = New ReportClientDocumentClass()
 rcd.ReportAppServer = "hostname:port"
 rcd.[New]()
 Dim reportDirectory As String = "C:\"
 Dim reportDir As Object = DirectCast(reportDirectory, Object)
 rcd.SaveAs("MyNewUnmanagedReport.rpt", reportDir, CInt(CdReportClientDocumentSaveAsOptionsEnum.cdReportClientDocumentSaveAsOverwriteExisting))
 rcd.Close()
End Sub

C#

private void CreateNewUnmanagedReport()
{
 ISCDReportClientDocument rcd = new ReportClientDocumentClass();
 rcd.ReportAppServer = "hostname:port";
 rcd.New();
 string reportDirectory = "C:\\";
 object reportDir = (object)reportDirectory;
 rcd.SaveAs("MyNewUnmanagedReport.rpt", ref reportDir, (int)CdReportClientDocumentSaveAsOptionsEnum.cdReportClientDocumentSaveAsOverwriteExisting);
 rcd.Close();
}

This list includes the namespaces used by the sample code:

After creating a new, blank report, the report can be further modified to establish a data source connection, add tables and table links, and design the layout.

See Also

© 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: Easy to use tool to create HTML Help files and Help web sites