I am new enough to Crystal that I am not comfortable with parameters yet (though they are probably quite easy and the way to go as you have outlined above). So, I trudged down the road of using the object model.
This code snippet works (but I concur that this seems like overload):
final ReportObjectController c = oReportClientDocument.getReportDefController().getReportObjectController();
final IReportObject ro = oReportClientDocument.getReportDocument().getReportDefinition().findObjectByName("txtReportOptions");
log.debug(ro == null);
if (ro instanceof ITextObject) {
final TextObject orig = (TextObject)ro;
final TextObject copy = (TextObject)orig.clone(true);
final IParagraphElement elem = copy.getParagraphs().getParagraph(0).getParagraphElements().getParagraphElement(0);
if (elem instanceof IParagraphTextElement) {
final IParagraphTextElement updated = (IParagraphTextElement)elem;
log.debug(updated.getText());
updated.setText("new-text-goes-here");
}
c.modify(orig, copy);
}
Edited by underdog - 29 Jul 2009 at 6:26pm