Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 3
0
 public static void moveGroup(cReportGroup group, cEditor editor)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 private void pSetName(cReportGroup c, String name)
 {
     c.setName(pSetName(c.getName(), name));
 }
Exemplo n.º 5
0
 private void pSetName(cReportGroup c, String name)
 {
     c.setName(pSetName(c.getName(), name));
 }
Exemplo n.º 6
0
        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;
            }
        }