Inheritance: IDisposable, cIReportSection
        public cReportPageInfo add(
            cReportSectionLine sectionLine,
            cReportPageInfo c,
            String key)
        {
            try
            {
                if (c == null)
                {
                    c = new cReportPageInfo();
                }
                if (key == "")
                {
                    key = cReportGlobals.getNextKey().ToString();
                }

                key = cReportGlobals.getKey(key);
                Add(key, c);
                c.setSectionLine(sectionLine);
                return(c);
            }
            catch
            {
                return(null);
            }
        }
Esempio n. 2
0
        internal bool save(CSXml.cXml xDoc, XmlNode nodeFather)
        {
            CSXml.cXmlProperty xProperty = null;
            XmlNode            nodeObj   = null;

            xProperty = new CSXml.cXmlProperty();

            xProperty.setName(m_key);
            nodeObj = xDoc.addNodeToNode(nodeFather, xProperty);

            xProperty.setName("Name");
            xProperty.setValue(eTypes.eText, m_name);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("Key");
            xProperty.setValue(eTypes.eText, m_key);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            // TODO: fix me - this is Spanish - English bug we should use Index
            //
            xProperty.setName("Indice");
            xProperty.setValue(eTypes.eInteger, m_index);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("TypeSection");
            xProperty.setValue(eTypes.eInteger, getTypeSection());
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("HasFormulaHide");
            xProperty.setValue(eTypes.eBoolean, m_hasFormulaHide);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            if (!m_aspect.save(xDoc, nodeObj))
            {
                return(false);
            }
            if (!m_formulaHide.save(xDoc, nodeObj))
            {
                return(false);
            }

            xProperty.setName(C_NODERPTSECTIONLINES);
            xProperty.setValue(eTypes.eText, "");
            nodeObj = xDoc.addNodeToNode(nodeObj, xProperty);

            cReportSectionLine seccLn = null;

            for (int _i = 0; _i < m_sectionLines.count(); _i++)
            {
                seccLn = m_sectionLines.item(_i);
                seccLn.save(xDoc, nodeObj);
            }

            return(true);
        }
Esempio n. 3
0
        internal void setCopyColl(cReportControls2 rhs)
        {
            cReportSectionLine sectionLn = null;

            m_copyColl = rhs;

            for (int _i = 0; _i < this.count(); _i++)
            {
                sectionLn = item(_i);
                sectionLn.setCopyColl(rhs);
            }
        }
Esempio n. 4
0
        public void setSectionLine(cReportSectionLine rhs)
        {
            m_sectionLine = rhs;

            cReportControl ctrl = null;

            for (int _i = 0; _i < this.Count; _i++)
            {
                ctrl = item(_i);
                ctrl.setSectionLine(rhs);
            }
        }
Esempio n. 5
0
        internal bool load(CSXml.cXml xDoc, XmlNode nodeObj)
        {
            XmlNode            nodeObjSecLn  = null;
            XmlNode            nodeObjAspect = null;
            cReportSectionLine secLn         = null;

            m_name = xDoc.getNodeProperty(nodeObj, "Name").getValueString(eTypes.eText);

            // TODO: fix me - this is Spanish - English bug we should use Index
            //
            m_index = xDoc.getNodeProperty(nodeObj, "Indice").getValueInt(eTypes.eInteger);

            setTypeSection((csRptSectionType)xDoc.getNodeProperty(nodeObj, "TypeSection").getValueInt(eTypes.eInteger));
            m_hasFormulaHide = xDoc.getNodeProperty(nodeObj, "HasFormulaHide").getValueBool(eTypes.eBoolean);

            nodeObjAspect = nodeObj;
            if (!m_aspect.load(xDoc, nodeObjAspect))
            {
                return(false);
            }

            XmlNode nodeObjAux = nodeObj;

            if (!m_formulaHide.load(xDoc, nodeObjAux))
            {
                return(false);
            }

            m_sectionLines.clear();

            nodeObj = xDoc.getNodeFromNode(nodeObj, C_NODERPTSECTIONLINES);
            if (xDoc.nodeHasChild(nodeObj))
            {
                nodeObjSecLn = xDoc.getNodeChild(nodeObj);
                while (nodeObjSecLn != null)
                {
                    String key = xDoc.getNodeProperty(nodeObjSecLn, "Key").getValueString(eTypes.eText);
                    secLn = m_sectionLines.add(null, key, -1);
                    if (!secLn.load(xDoc, nodeObjSecLn))
                    {
                        return(false);
                    }
                    secLn.setSectionName(m_name);
                    nodeObjSecLn = xDoc.getNextNode(nodeObjSecLn);
                }
            }

            return(true);
        }
        public cReportSectionLine add(cReportSectionLine c, String key, int index)
        {
            try
            {
                if (c == null) 
                { 
                    c = new cReportSectionLine(); 
                }
                if (key == "")
                {
                    key = cReportGlobals.getNextKey().ToString();
                }
                else
                {
                    cReportGlobals.refreshNextKey(key);
                }

                key = cReportGlobals.getKey(key);

                if ((index != -1) && this.count() > 0)
                {
                    m_keys.Insert(index, key);
                }
                else
                {
                    m_keys.Add(key);
                }

                m_coll.Add(key, c);

                c.setCopyColl(m_copyColl);
                c.setTypeSection(m_typeSection);

                pRefreshIndex();
                c.setIndex(this.count()-1);
                c.setKey(key);

                return c;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Esempio n. 7
0
        public cReportSectionLine add(cReportSectionLine c, String key, int index)
        {
            try
            {
                if (c == null)
                {
                    c = new cReportSectionLine();
                }
                if (key == "")
                {
                    key = cReportGlobals.getNextKey().ToString();
                }
                else
                {
                    cReportGlobals.refreshNextKey(key);
                }

                key = cReportGlobals.getKey(key);

                if ((index != -1) && this.count() > 0)
                {
                    m_keys.Insert(index, key);
                }
                else
                {
                    m_keys.Add(key);
                }

                m_coll.Add(key, c);

                c.setCopyColl(m_copyColl);
                c.setTypeSection(m_typeSection);

                pRefreshIndex();
                c.setIndex(this.count() - 1);
                c.setKey(key);

                return(c);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Esempio n. 8
0
        public void remove(String key)
        {
            try
            {
                cReportSectionLine w_item = item(key);
                if (w_item != null)
                {
                    if (w_item.getControls() != null)
                    {
                        w_item.getControls().clear();
                        w_item.getControls().setSectionLine(null);
                        w_item.getControls().setCopyColl(null);
                    }
                    m_coll.Remove(key);
                    m_keys.Remove(key);
                }

                return;
            }
            catch
            {
            }
        }
Esempio n. 9
0
        public void remove(int index)
        {
            try
            {
                cReportSectionLine w_item = item(index);
                if (w_item != null)
                {
                    if (w_item.getControls() != null)
                    {
                        w_item.getControls().clear();
                        w_item.getControls().setSectionLine(null);
                        w_item.getControls().setCopyColl(null);
                    }
                    m_coll.Remove(m_keys[index]);
                    m_keys.RemoveAt(index);
                }

                return;
            }
            catch
            {
            }
        }
 public void setSectionLine(cReportSectionLine rhs)
 {
     m_sectionLine = rhs;
 }
Esempio n. 11
0
        private void pChangeSecLnHeight(
            CSReportPaint.cReportPaintObject paintObj, 
            float y, 
            float minBottom, 
            float maxBottom, 
            cReportSectionLine secLn) 
        { 
            cReportAspect w_aspect = paintObj.getAspect();

            // if Y is contained between the range allowed everything is ok
            //
            if (y >= minBottom && y <= maxBottom) {
                w_aspect.setTop(y - m_offY);
            } 
            else {
                // if it have been moved upward
                //
                if (y < minBottom) {
                    w_aspect.setTop(minBottom);

                } 
                // if it have been moved downward
                //
                else {
                    w_aspect.setTop(maxBottom);
                }
            }

            // because the top has been setted to the real dimensions
            // of the screen now we need to move it the offset
            // of its section
            //
            w_aspect.setTop(w_aspect.getTop() + w_aspect.getOffset());

            m_paint.alingToGrid(paintObj.getKey());

            // the section line height has been changed
            //
            secLn.getAspect().setHeight(w_aspect.getTop() 
                                        + cGlobals.C_HEIGHT_BAR_SECTION 
                                        - secLn.getAspect().getTop());
        }
Esempio n. 12
0
        private bool getLineRegionForControl(String sKeyPaintObj, 
                                                out cReportSectionLine rptSecLine, 
                                                bool isFreeCtrl) 
        { 
            cReportSection rptSection = null;
	
            rptSecLine = null;

            if (!getRegionForControl(sKeyPaintObj, out rptSection, isFreeCtrl)) { return false; }

            float w1 = 0;
            float w2 = 0;

            float y = 0;

            cReportSectionLine rtnSecLine = null;

            cReportAspect w_aspect = m_paint.getPaintObject(sKeyPaintObj).getAspect();
            if (isFreeCtrl) {
                y = w_aspect.getTop() + w_aspect.getOffset();
            } 
            else {
                y = w_aspect.getTop() + w_aspect.getHeight() / 2 + w_aspect.getOffset();
            }

            for (int _i = 0; _i < rptSection.getSectionLines().count(); _i++) {
                cReportSectionLine rptSL = rptSection.getSectionLines().item(_i);
                w_aspect = rptSL.getAspect();
                w1 = w_aspect.getTop();
                w2 = w_aspect.getTop() + w_aspect.getHeight();
                if (isFreeCtrl) {
                    if (w1 <= y) {
                        rtnSecLine = rptSL;
                    }
                } 
                else {
                    if (w1 <= y && w2 >= y) { return false; }
                }
            }

            if (rtnSecLine != null) {
                rptSecLine = rtnSecLine;
                return true;
            }
            else {
                return false;
            }
        }
Esempio n. 13
0
        private cReportSection pGetSection(
            out bool isGroup, 
            out bool isSecLn, 
			out cReportSectionLine secLn,
            bool returnSecLn,
            out bool isGroupHeader,
            out bool isGroupFooter) 
        {

            cReportSection sec = null;

            isGroup = false;
            isSecLn = false;
            secLn = null;
            isGroupFooter = false;
            isGroupHeader = false;

			if (m_keyFocus == "") { return null; }

            // get the section and show his properties
            //
			if (!m_paint.paintObjIsSection(m_keyFocus)) { return null; }

			CSReportPaint.cReportPaintObject paintObj = m_paint.getPaintSections().item(m_keyFocus);

            // nothing to do
            //
			if (paintObj == null) { return null; }

            sec = m_report.getHeaders().item(paintObj.getTag());
            if (sec != null) {

                // it's a header
            } 
            else {
                sec = m_report.getFooters().item(paintObj.getTag());
                if (sec != null) {

                    // it's a footer
                } 
                else {

                    // check if it is a group
                    //
                    sec = m_report.getGroupsHeaders().item(paintObj.getTag());
                    if (sec != null) {

                        // it's a group
                        //
                        isGroup = true;
                        isGroupHeader = true;

                    } 
                    else {
                        sec = m_report.getGroupsFooters().item(paintObj.getTag());
                        if (sec != null) {

                            // it's a group
                            //
                            isGroup = true;
                            isGroupFooter = true;

                        } 
                        else {
                            // check if it is a detail
                            //
                            sec = m_report.getDetails().item(paintObj.getTag());
                            if (sec != null) {

                                // it's a detail

                                // it's a line
                            } 
                            else {
                                isSecLn = true;
                                switch (paintObj.getRptType()) {
                                    case csRptTypeSection.C_KEY_SECLN_HEADER:
                                        sec = m_report.getHeaders().item(paintObj.getRptKeySec());
                                        break;
                                    case csRptTypeSection.C_KEY_SECLN_DETAIL:
                                        sec = m_report.getDetails().item(paintObj.getRptKeySec());
                                        break;
                                    case csRptTypeSection.C_KEY_SECLN_FOOTER:
                                        sec = m_report.getFooters().item(paintObj.getRptKeySec());
                                        break;
                                    case csRptTypeSection.C_KEY_SECLN_GROUPH:
                                        sec = m_report.getGroupsHeaders().item(paintObj.getRptKeySec());
                                        break;
                                    case csRptTypeSection.C_KEY_SECLN_GROUPF:
                                        sec = m_report.getGroupsFooters().item(paintObj.getRptKeySec());
                                        break;
                                }
								secLn = sec.getSectionLines().item(paintObj.getTag());
                            }
                        }
                    }
                }
            }

            // if the caller wants a section line and the separator
            // is owned by a section (isSecLn == false) we return
            // the last section line of the section asociated to the separator
            //
            if (returnSecLn && !isSecLn) {
				secLn = sec.getSectionLines().item(sec.getSectionLines().count());
                isSecLn = true;
            }

            return sec;
        }
Esempio n. 14
0
 private cReportSection pGetSection(
     out bool isSecLn,
     out cReportSectionLine secLn,
     bool returnSecLn,
     out bool isGroupHeader,
     out bool isGroupFooter)
 { 
     bool isGroup;
     return pGetSection(out isGroup, out isSecLn, out secLn, returnSecLn, out isGroupHeader, out isGroupFooter);
 }
Esempio n. 15
0
        private bool getLineRegionForControl(String sKeyPaintObj,
                                                out cReportSectionLine rptSecLine,
                                                bool isFreeCtrl)
        {
            cReportSection rptSection = null;

            rptSecLine = null;

            if (!getRegionForControl(sKeyPaintObj, out rptSection, isFreeCtrl)) { return false; }

            float w1 = 0;
            float w2 = 0;

            float y = 0;

            cReportSectionLine rtnSecLine = null;

            cReportAspect w_aspect = m_paint.getPaintObject(sKeyPaintObj).getAspect();
            if (isFreeCtrl) {
                y = w_aspect.getTop() + w_aspect.getOffset();
            }
            else {
                y = w_aspect.getTop() + w_aspect.getHeight() / 2 + w_aspect.getOffset();
            }

            for (int _i = 0; _i < rptSection.getSectionLines().count(); _i++) {
                cReportSectionLine rptSL = rptSection.getSectionLines().item(_i);
                w_aspect = rptSL.getAspect();
                w1 = w_aspect.getTop();
                w2 = w_aspect.getTop() + w_aspect.getHeight();
                if (isFreeCtrl) {
                    //
                    // if the control is a free control
                    // this function will return the last sectionLine which
                    // has a bottom bigger than the top of the control
                    //
                    if (w1 <= y) {
                        rtnSecLine = rptSL;
                    }
                }
                else {
                    //
                    // if the control is not a free control
                    // this function will return the section line
                    // which contains the control
                    //
                    if (w1 <= y && w2 >= y) {
                        rtnSecLine = rptSL;
                        break;
                    }
                }
            }

            //
            // if the control is not a free contrl and there wasn't a
            // section line which contained the top of the control
            // (I think that can't be posible but anyways)
            // this function will return false and rptSecLine will be null
            //

            if (rtnSecLine != null) {
                rptSecLine = rtnSecLine;
                return true;
            }
            else {
                return false;
            }
        }
Esempio n. 16
0
 public void setSectionLine(cReportSectionLine rhs)
 {
     m_sectionLine = rhs;
 }
        public void setSectionLine(cReportSectionLine rhs)
        {
            m_sectionLine = rhs;

            cReportControl ctrl = null;
            for (int _i = 0; _i < this.Count; _i++)
            {
                ctrl = item(_i);
                ctrl.setSectionLine(rhs);
            }
        }
        public cReportPageInfo add(
            cReportSectionLine sectionLine,
            cReportPageInfo c,
            String key)
        {
            try
            {
                if (c == null) 
                { 
                    c = new cReportPageInfo(); 
                }
                if (key == "")
                {
                    key = cReportGlobals.getNextKey().ToString();
                }

                key = cReportGlobals.getKey(key);
                Add(key, c);
                c.setSectionLine(sectionLine);
                return c;
            }
            catch
            {
                return null;
            }
        }