public cReportGroup add2(cReportGroup c, String key) { try { if (c == null) { c = new cReportGroup(); } if (key == "") { key = cReportGlobals.getNextKey().ToString(); } else { cReportGlobals.refreshNextKey(key); } key = cReportGlobals.getKey(key); Add(key, c); c.setKey(key); c.setIndex(this.Count); m_groupsHeaders.add(c.getHeader(), "", -1); m_groupsFooters.add(c.getFooter(), "", 0); pSetName(c, "G_" + c.getIndex().ToString()); pSetName(c.getHeader(), c.getName()); pSetName(c.getFooter(), c.getName()); c.getHeader().setTypeSection(csRptSectionType.GROUP_HEADER); c.getFooter().setTypeSection(csRptSectionType.GROUP_FOOTER); return(c); } catch { return(null); } }
private void pShowGroupProperties(cReportGroup group) { try { bool isNew = false; m_showingProperties = true; if (m_fGroup == null) { m_fGroup = new fGroup(); } m_fGroup.setHandler(this); if (group == null) { isNew = true; } if (isNew) { m_fGroup.txName.Text = "Group" + m_report.getGroups().count() + 1; } else { m_fGroup.txName.Text = group.getName(); m_fGroup.txDbField.Text = group.getFieldName(); if (group.getOderType() == csRptGrpOrderType.CSRPTGRPASC) { m_fGroup.opAsc.Checked = true; } else { m_fGroup.opDesc.Checked = true; } m_fGroup.chkPrintInNewPage.Checked = group.getPrintInNewPage(); m_fGroup.chkReprintGroup.Checked = group.getRePrintInNewPage(); m_fGroup.chkGrandTotal.Checked = group.getGrandTotalGroup(); switch (group.getComparisonType()) { case csRptGrpComparisonType.CSRPTGRPDATE: m_fGroup.opDate.Checked = true; break; case csRptGrpComparisonType.CSRPTGRPNUMBER: m_fGroup.opNumber.Checked = true; break; case csRptGrpComparisonType.CSRPTGRPTEXT: m_fGroup.opText.Checked = true; break; } } m_fGroup.lbGroup.Text = "Group: " + m_fGroup.txName.Text; m_fGroup.ShowDialog(); if (m_fGroup.getOk()) { if (isNew) { group = m_report.getGroups().add(null, ""); } group.setName(m_fGroup.txName.Text); group.setFieldName(m_fGroup.txDbField.Text); group.setIndex(m_report.getGroups().Count); group.setOderType(m_fGroup.opAsc.Checked ? csRptGrpOrderType.CSRPTGRPASC : csRptGrpOrderType.CSRPTGRPDESC); group.setPrintInNewPage(m_fGroup.chkPrintInNewPage.Checked); group.setRePrintInNewPage(m_fGroup.chkReprintGroup.Checked); group.setGrandTotalGroup(m_fGroup.chkGrandTotal.Checked); if (m_fGroup.opDate.Checked) { group.setComparisonType(csRptGrpComparisonType.CSRPTGRPDATE); } else if (m_fGroup.opNumber.Checked) { group.setComparisonType(csRptGrpComparisonType.CSRPTGRPNUMBER); } else if (m_fGroup.opText.Checked) { group.setComparisonType(csRptGrpComparisonType.CSRPTGRPTEXT); } if (isNew) { addSection(csRptSectionType.GROUP_HEADER); addSection(csRptSectionType.GROUP_FOOTER); } m_dataHasChanged = true; } } catch (Exception ex) { cError.mngError(ex, "showGroupProperties", C_MODULE, ""); } finally { m_showingProperties = false; if (m_fGroup != null) { m_fGroup.Close(); m_fGroup = null; } } }
public static void moveGroup(cReportGroup group, cEditor editor) { throw new NotImplementedException(); }
private void pSetName(cReportGroup c, String name) { c.setName(pSetName(c.getName(), name)); }
public cReportGroup add2(cReportGroup c, String key) { try { if (c == null) { c = new cReportGroup(); } if (key == "") { key = cReportGlobals.getNextKey().ToString(); } else { cReportGlobals.refreshNextKey(key); } key = cReportGlobals.getKey(key); Add(key, c); c.setKey(key); c.setIndex(this.Count); m_groupsHeaders.add(c.getHeader(), "", -1); m_groupsFooters.add(c.getFooter(), "", 0); pSetName(c, "G_" + c.getIndex().ToString()); pSetName(c.getHeader(), c.getName()); pSetName(c.getFooter(), c.getName()); c.getHeader().setTypeSection(csRptSectionType.GROUP_HEADER); c.getFooter().setTypeSection(csRptSectionType.GROUP_FOOTER); return c; } catch { return null; } }