You must configure the Report Application Server
(RAS) to work with unmanaged reports before you can create a report on the file
system.
New, unmanaged reports on a file path accessible
to a RAS server can be created using the
ReportClientDocument.newDocument
method.
Note: Do not use the
IReportAppFactory.newDocument
method, which is reserved for creating new, managed reports in an Enterprise
repository.
Create a new
ReportClientDocument object.
ReportClientDocument rcd = new ReportClientDocument();
Set the name and port of the RAS
server used to open and process the report.
rcd.setReportAppServer("hostname:port"); Call the
newDocument method of the
ReportClientDocument class to
create a new, blank report.
Save your new, blank report to a
folder accessible to the RAS server and close the report .
rcd.saveAs("MyNewReport.rpt", "C:\\MyReports\\", ReportSaveAsOptions._overwriteExisting);
rcd.close();
Example:
The following code creates a new, blank,
unmanaged report called
MyNewReport.rpt in the folder
C:\MyReports.
void createNewUnmanagedReport() throws ReportSDKException, IOException
{
ReportClientDocument rcd = new ReportClientDocument();
rcd.setReportAppServer("hostname:port");
rcd.newDocument();
rcd.saveAs("MyNewReport.rpt", "C:\\MyReports\\", ReportSaveAsOptions._overwriteExisting);
rcd.close();
}This list includes the classes used by the sample
code:
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument
com.crystaldecisions.sdk.occa.report.application.ReportSaveAsOptions
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException
java.io.IOException
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.