add() публичный Метод

public add ( cReportPageField c ) : cReportPageField
c cReportPageField
Результат cReportPageField
Пример #1
0
        internal bool load(CSXml.cXml xDoc, XmlNode nodeObj)
        {
            XmlNode nodeObjSecLn = null;

            m_pageNumber   = xDoc.getNodeProperty(nodeObj, "PageNumber").getValueInt(eTypes.eInteger);
            m_headerBottom = xDoc.getNodeProperty(nodeObj, "HeaderBottom").getValueInt(eTypes.eLong);
            m_footerTop    = xDoc.getNodeProperty(nodeObj, "FooterTop").getValueInt(eTypes.eLong);

            m_header.clear();
            m_detail.clear();
            m_footer.clear();

            nodeObj = xDoc.getNodeFromNode(nodeObj, C_NODERPTHEADER);
            if (xDoc.nodeHasChild(nodeObj))
            {
                nodeObjSecLn = xDoc.getNodeChild(nodeObj);
                while (nodeObjSecLn != null)
                {
                    if (!m_header.add(null).load(xDoc, nodeObjSecLn))
                    {
                        return(false);
                    }
                    nodeObjSecLn = xDoc.getNextNode(nodeObjSecLn);
                }
            }

            nodeObj = xDoc.getNodeFromNode(nodeObj, C_NODERPTDETAIL);
            if (xDoc.nodeHasChild(nodeObj))
            {
                nodeObjSecLn = xDoc.getNodeChild(nodeObj);
                while (nodeObjSecLn != null)
                {
                    if (!m_detail.add(null).load(xDoc, nodeObjSecLn))
                    {
                        return(false);
                    }
                    nodeObjSecLn = xDoc.getNextNode(nodeObjSecLn);
                }
            }

            nodeObj = xDoc.getNodeFromNode(nodeObj, C_NODERPTFOOTER);
            if (xDoc.nodeHasChild(nodeObj))
            {
                nodeObjSecLn = xDoc.getNodeChild(nodeObj);
                while (nodeObjSecLn != null)
                {
                    if (!m_footer.add(null).load(xDoc, nodeObjSecLn))
                    {
                        return(false);
                    }
                    nodeObjSecLn = xDoc.getNextNode(nodeObjSecLn);
                }
            }

            return(true);
        }
Пример #2
0
        private void getLineAux(cReportSection sec, cReportPageFields fields)
        {
            // for every control in every section line of sec
            // we need to create a new cPageField
            //
            cReportPageField field = null;
            cReportSectionLine secLn = null;
            cReportControl ctrl = null;
            bool isVisible = false;
            int indexCtrl = 0;

            // this indexes are used to
            //
            // indicate in which data source is this field
            //
            int indexRows = 0;
            //
            // in which row is this field
            //
            int indexRow = 0;
            //
            // in which column is this field
            //
            int indexField = 0;

            if (sec.getHasFormulaHide())
            {
                isVisible = cUtil.val(m_compiler.resultFunction(sec.getFormulaHide())) != 0;
            }
            else
            {
                isVisible = true;
            }

            if (isVisible)
            {
                // for every section line in sec
                //
                for (int _i = 0; _i < sec.getSectionLines().count(); _i++)
                {
                    secLn = sec.getSectionLines().item(_i);
                    m_lineIndex++;

                    if (secLn.getHasFormulaHide())
                    {
                        m_compiler.evalFunction(secLn.getFormulaHide());
                        isVisible = cUtil.val(m_compiler.resultFunction(secLn.getFormulaHide())) != 0;
                    }
                    else
                    {
                        isVisible = true;
                    }

                    if (isVisible)
                    {
                        // for every control in the section line
                        //
                        int[] collByLeft = secLn.getControls().getCollByLeft();
                        for (indexCtrl = 0; indexCtrl < collByLeft.Length; indexCtrl++)
                        {
                            ctrl = secLn.getControls().item(collByLeft[indexCtrl]);

                            // add a new field to the collection
                            //
                            field = fields.add(null, "");
                            field.setIndexLine(m_lineIndex);

                            if (ctrl.getHasFormulaValue())
                            {
                                field.setValue(
                                    cReportGlobals.format(
                                        m_compiler.resultFunction(ctrl.getFormulaValue()),
                                        ctrl.getLabel().getAspect().getFormat()));
                            }
                            else
                            {
                                cReportLabel w_label = null;
                                switch (ctrl.getControlType())
                                {
                                    case csRptControlType.CSRPTCTFIELD:

                                        pGetIndexRows(out indexRows, out indexRow, out indexField, ctrl);

                                        if (m_collRows[indexRows] != null)
                                        {
                                            // it looks ugly, dont think you?
                                            //
                                            // maybe this help a litle:
                                            //
                                            //    m_vCollRows(IndexRows)    a matrix with the data 
                                            //                              contained in the datasource
                                            //                              referd by this control
                                            //
                                            //    (IndexField, IndexRow)    a cell in this matrix
                                            //
                                            object value = m_collRows[indexRows].Rows[indexRow][indexField];
                                            field.setValue(
                                                cReportGlobals.format(
                                                    cReportGlobals.valVariant(value),
                                                    ctrl.getLabel().getAspect().getFormat()));
                                        }
                                        break;

                                    case csRptControlType.CSRPTCTLABEL:
                                        w_label = ctrl.getLabel();
                                        field.setValue(cReportGlobals.format(w_label.getText(), w_label.getAspect().getFormat()));
                                        break;

                                    case csRptControlType.CSRPTCTIMAGE:
                                        w_label = ctrl.getLabel();
                                        field.setValue(cReportGlobals.format(w_label.getText(), w_label.getAspect().getFormat()));
                                        field.setImage(ctrl.getImage().getImage());
                                        break;

                                    case csRptControlType.CSRPTCTDBIMAGE:
                                        pGetIndexRows(out indexRows, out indexRow, out indexField, ctrl);
                                        if (m_collRows[indexRows] != null)
                                        {
                                            field.setImage(pGetImage(indexRows, indexField, indexRow));
                                        }
                                        break;

                                    case csRptControlType.CSRPTCTCHART:
                                        pGetIndexRows(out indexRows, out indexRow, out indexField, ctrl);
                                        field.setImage(pGetChartImage(indexRows, indexField, indexRow, ctrl));
                                        break;
                                }
                            }

                            if (ctrl.getHasFormulaHide())
                            {
                                field.setVisible(cUtil.val(m_compiler.resultFunction(ctrl.getFormulaHide())) != 0);
                            }
                            else
                            {
                                field.setVisible(true);
                            }

                            // set a reference to the definition of this field
                            //
                            field.setInfo(m_pageSetting.item(ctrl.getKey()));
                        }
                    }
                }
            }
        }
Пример #3
0
        private CSReportDll.cReportPageFields pGetLineAux(int indexLine, CSReportDll.cReportPageFields fields)
        {
            CSReportDll.cReportPageFields flds = new CSReportDll.cReportPageFields();

            for (int _i = 0; _i < fields.count(); _i++)
            {
                CSReportDll.cReportPageField fld = fields.item(_i);
                if (fld.getIndexLine() == indexLine)
                {
                    flds.add(fld);
                }
            }
            return flds;
        }