CR Report Designer and section names for programmatic access
I'm using the CR XI R2 Report Designer to design reports. As an example, one report has three page footer sections, two of which I have to suppress and the other enable at display time based on other calculations. In the CR Designer Section Expert, these sections are named:
Page Footer a
Page Footer b
Page Footer c
However, If I try to access these sections programatically, say from JDC,
sec1 = (Section) rdcPDchart.getReportDefController().getReportDefinition().findSectionByName("Page Footer a");
sec1 will be null.
If I enumerate the section names in the page footer with:
secs1 = (Sections) rdcPDchart.getReportDefController().getReportDefinition().getPageFooterArea().getSections();
for (int i = 0; i < secs1.size(); i++ )
System.out.println("section: " + secs1.getSection(i).getName());
The output will be:
and I can access and manipulate the sections without difficutly using the above names.
I can understand how these names came about..."Section6" was probably the original page footer section in the blank report, and I later added two other page footer sections.
However, it becomes very difficult to manipulate the sections of a report programatically with findSectionByName() when the section names available for programatic access don't seem to correspond to names shown in the Report Designer Section Expert.
From the Report Designer, is there any way to determine what the names of the sections will be for programmatic access? Is there a way to change the section names from the report designer? I know you can do this with the VB RDC via the properties box, but there doesn't seem to be any way to change section names in the Crystal Reports Designer.
Edited by: Joseph Huber on Apr 12, 2010 4:01 PM
Edited by: Joseph Huber on Apr 12, 2010 4:03 PM