private void addTextSectionCopies(){
CurReportDocument.setLayoutSectionsVisible(false);
XTextCursor xTextCursor = ReportDocument.createTextCursor(CurReportDocument.xTextDocument.getText());
xTextCursor.gotoStart(false);
for (int i = 0; i < CurReportDocument.CurDBMetaData.GroupFieldNames.length; i++){
XNamed xNamedTextSection = addLinkedTextSection(xTextCursor, GROUPSECTION + Integer.toString(i + 1), null, null);
xNamedTextSection.setName(COPYOFGROUPSECTION + (i+1));
renameTableofLastSection(COPYOFTBLGROUPSECTION + (i+1));
}
if( CurReportDocument.CurDBMetaData.RecordFieldNames.length > 0){
XNamed xNamedTextSection = addLinkedTextSection(xTextCursor, RECORDSECTION, null, null);
xNamedTextSection.setName(COPYOFRECORDSECTION);
renameTableofLastSection(COPYOFTBLRECORDSECTION);
}
}