Hi everybody,
one of our costumers periodically creates publications with many crystal reports. The reports are based on a few reports which are copied and set with different parameters (for example a report is copied 50 times for 50 different departments). The output format of the publication is pdf.
I'm writing a tool in Java to automate this process. Everything works fine, but the bookmarks in adobe reader are not named after the titles of the report copies, but are named after the name of the original report.
What my program does so far (abstract, pseudo-code):
IInfoObjects objects = Infostore.query("Query to get the reports");
for(report : objects) {
IInfoObject new = objects.copy(report, copymode);
new.setTitle("new Title");
setParameter(new, parameter) // method which sets the parameter in the report copy
new.save();
//go on with creating the publication
}
Changing the title of the InfoObject doesn't change the bookmark in the created pdf. To set the report title (which will change the bookmark), I can do the following:
ReportClientDocument rcd = reportAppFactory.openDocument(new; OpenReportOptions._openAsReadOnly, java.util.Locale.GERMAN);
ISummaryInfo s1 = rcd.getSummaryInfo();
ISummaryInfo s2 = s1.clone(true);
s2.setTitle("new title");
rcd.modifySummaryInfo(s2);
rcd.saveAs(new.getTitle(), parentFolderID, ReportSaveAsOptions._overwriteExisting);
rcd.close();
The problem here is that when I save the ReportClientDocument instance (rcd), the InfoObject (new) will be changed and the parameter (set before)and database logon information (username, password (is entered via CMC in the report before the copies are made)) are getting lost.
Can somebody help me how to change the title of the report so that the bookmarks will be named correctly and now information is lost in the infoobjects?
Regards,
Marius