getLabel() public méthode

public getLabel ( ) : cReportLabel
Résultat cReportLabel
Exemple #1
0
        public void orderCollByLeft()
        {
            int            j    = 0;
            int            i    = 0;
            int            tmp  = 0;
            cReportControl ctl1 = null;
            cReportControl ctl2 = null;

            G.redim(ref m_collByLeft, this.Count);

            for (i = 0; i < m_collByLeft.Length; i++)
            {
                m_collByLeft[i] = i;
            }

            for (i = 0; i < this.Count - 1; i++)
            {
                for (j = i; j < this.Count - 1; j++)
                {
                    ctl1 = item(m_collByLeft[j]);
                    ctl2 = item(m_collByLeft[j + 1]);

                    if (ctl2.getLabel().getAspect().getLeft() < ctl1.getLabel().getAspect().getLeft())
                    {
                        tmp                 = m_collByLeft[j];
                        m_collByLeft[j]     = m_collByLeft[j + 1];
                        m_collByLeft[j + 1] = tmp;
                    }
                }
            }
        }
		private void pSetNewControlPosition(cReportControl ctrl, float left, float top) {
            cReportAspect aspect = ctrl.getLabel().getAspect();
            aspect.setLeft(left);
            aspect.setTop(top);

            cReportPaintObject paintObj = null;
			csRptPaintObjType paintType = csRptPaintObjType.CSRPTPAINTOBJBOX;

            if (ctrl.getControlType() == csRptControlType.CSRPTCTIMAGE 
                || ctrl.getControlType() == csRptControlType.CSRPTCTCHART) {
                paintType = CSReportPaint.csRptPaintObjType.CSRPTPAINTOBJIMAGE;
            }

            paintObj = m_paint.getNewObject(paintType);

            aspect = ctrl.getLabel().getAspect();

			pCopyAspectToPaint(aspect, paintObj.getAspect());

            aspect.setLeft(left);
            aspect.setTop(top);

            paintObj.setText(ctrl.getLabel().getText());

            paintObj.setRptType(csRptTypeSection.CONTROL);

            paintObj.setTag(ctrl.getKey());
            ctrl.setKeyPaint(paintObj.getKey());

            // position the control in the desired section line
            //
            moveControl(paintObj.getKey());

			m_paint.drawObject(paintObj.getKey(), m_graphic);
        }
        private void pSetNewControlProperties(cReportControl ctrl) { 
			cReportAspect aspect = null;

            ctrl.getLabel().getAspect().setAlign(CSReportGlobals.HorizontalAlignment.Left);

            switch (m_controlType) {
                case csRptEditCtrlType.CSRPTEDITFIELD:
                    ctrl.setControlType(csRptControlType.CSRPTCTFIELD);
                    ctrl.getLabel().setText(m_fieldName);
                    cReportField field = ctrl.getField();
                    field.setIndex(m_fieldIndex);
                    field.setName(m_fieldName);
                    field.setFieldType(m_fieldType);

                    if (cGlobals.isNumberField(m_fieldType)) {
                        aspect = ctrl.getLabel().getAspect();
					    aspect.setAlign(CSReportGlobals.HorizontalAlignment.Right);
                        aspect.setFormat("#0.00;-#0.00");
                    }
                    break;

                case csRptEditCtrlType.CSRPTEDITFORMULA:
                    ctrl.setControlType(csRptControlType.CSRPTCTLABEL);
                    ctrl.getFormulaValue().setText(m_formulaText + "(" + m_controlName + ")");
                    ctrl.setHasFormulaValue(true);
                    ctrl.getLabel().getAspect().setFormat("0.00;-0.00");
                    ctrl.getLabel().getAspect().getFont().setBold(true);
                    ctrl.getLabel().setText(ctrl.getFormulaValue().getText());
                    ctrl.getLabel().getAspect().setAlign(CSReportGlobals.HorizontalAlignment.Right);
                    break;

                case csRptEditCtrlType.CSRPTEDITLABEL:
                    ctrl.setControlType(csRptControlType.CSRPTCTLABEL);
                    ctrl.getLabel().setText(m_fieldName);
                    ctrl.getLabel().getAspect().getFont().setBold(true);

                    break;
                case csRptEditCtrlType.CSRPTEDITIMAGE:
                    ctrl.setControlType(csRptControlType.CSRPTCTIMAGE);
                    ctrl.getLabel().setText(m_fieldName);

                    break;
                case csRptEditCtrlType.CSRPTEDITCHART:
                    ctrl.setControlType(csRptControlType.CSRPTCTCHART);
                    ctrl.getLabel().setText(m_fieldName);
                    break;
            }

            const int ctrl_height = 285;
            const int ctrl_width = 2000;

			aspect = ctrl.getLabel().getAspect();
            aspect.setWidth(ctrl_width);
            aspect.setHeight(ctrl_height);
            aspect.setTransparent(true);
        }
        private void pCopyControl(cReportControl fromCtrl, cReportControl toCtrl) { 
            toCtrl.setControlType(fromCtrl.getControlType());

            cReportField field = toCtrl.getField();
            field.setFieldType(fromCtrl.getField().getFieldType());
            field.setIndex(fromCtrl.getField().getIndex());
            field.setName(fromCtrl.getField().getName());

            toCtrl.getFormulaHide().setName(fromCtrl.getFormulaHide().getName());
            toCtrl.getFormulaHide().setText(fromCtrl.getFormulaHide().getText());
            toCtrl.getFormulaValue().setName(fromCtrl.getFormulaValue().getName());
            toCtrl.getFormulaValue().setText(fromCtrl.getFormulaValue().getText());

            toCtrl.setHasFormulaHide(fromCtrl.getHasFormulaHide());
            toCtrl.setHasFormulaValue(fromCtrl.getHasFormulaValue());

            pCopyAspect(fromCtrl.getImage().getAspect(), toCtrl.getImage().getAspect());

            cReportLabel label = toCtrl.getLabel();
            pCopyAspect(fromCtrl.getLabel().getAspect(), label.getAspect());
            label.setCanGrow(fromCtrl.getLabel().getCanGrow());
            label.setText(fromCtrl.getLabel().getText());

            pCopyAspect(fromCtrl.getLine().getAspect(), toCtrl.getLine().getAspect());
            pCopyChart(fromCtrl.getChart(), toCtrl.getChart());
        }
        private void pSetNewControlProperties(cReportControl ctrl) {
            const int CTRL_HEIGHT = 19;
            const int CTRL_WIDTH = 133;
            const int LINE_HEIGHT = 1;

            cReportLabel label = null;
            cReportAspect aspect = null;

            int ctrlHeigth = CTRL_HEIGHT;
            bool transparent = true;

            ctrl.getLabel().getAspect().setAlign(CSReportGlobals.HorizontalAlignment.Left);

            switch (m_controlType) {
                case csRptEditCtrlType.field:
                    ctrl.setControlType(csRptControlType.CSRPTCTFIELD);
                    ctrl.getLabel().setText(m_fieldName);
                    cReportField field = ctrl.getField();
                    field.setIndex(m_fieldIndex);
                    field.setName(m_fieldName);
                    field.setFieldType(m_fieldType);

                    if (cDatabaseGlobals.isNumberField(m_fieldType))
                    {
                        aspect = ctrl.getLabel().getAspect();
                        aspect.setAlign(CSReportGlobals.HorizontalAlignment.Right);
                        aspect.setFormat("#0.00;-#0.00");
                    }
                    break;

                case csRptEditCtrlType.formula:
                    ctrl.setControlType(csRptControlType.CSRPTCTLABEL);
                    ctrl.getFormulaValue().setText(m_formulaText + "(" + m_controlName + ")");
                    ctrl.setHasFormulaValue(true);
                    label = ctrl.getLabel();
                    aspect = label.getAspect();
                    aspect.setFormat("0.00;-0.00");
                    aspect.getFont().setBold(true);
                    label.setText(ctrl.getFormulaValue().getText());
                    aspect.setAlign(CSReportGlobals.HorizontalAlignment.Right);
                    break;

                case csRptEditCtrlType.label:
                    ctrl.setControlType(csRptControlType.CSRPTCTLABEL);
                    label = ctrl.getLabel();
                    label.setText(m_fieldName);
                    label.getAspect().getFont().setBold(true);
                    break;

                case csRptEditCtrlType.lineLabel:
                    ctrlHeigth = LINE_HEIGHT;
                    ctrl.setControlType(csRptControlType.CSRPTCTLABEL);
                    label = ctrl.getLabel();
                    label.setText(m_fieldName);
                    aspect = label.getAspect();
                    aspect.getFont().setBold(true);
                    aspect.setBackColor(Color.Gray.ToArgb());
                    transparent = false;
                    break;

                case csRptEditCtrlType.image:
                    ctrl.setControlType(csRptControlType.CSRPTCTIMAGE);
                    ctrl.getLabel().setText(m_fieldName);
                    break;

                case csRptEditCtrlType.chart:
                    ctrl.setControlType(csRptControlType.CSRPTCTCHART);
                    ctrl.getLabel().setText(m_fieldName);
                    break;
            }

            aspect = ctrl.getLabel().getAspect();
            aspect.setWidth(CTRL_WIDTH);
            aspect.setHeight(ctrlHeigth);
            aspect.setTransparent(transparent);
        }
 private Image pGetChartImage(int indexRows, int indexField, int indexRow, cReportControl ctrl)
 { // TODO: Use of ByRef founded Private Function pGetChartImage(ByVal IndexRows As Long, ByVal IndexField As Long, ByVal IndexRow As Long, ByRef ctrl As cReportControl) As Long
     if (ctrl.getChart().getChartCreated())
     {
         return ctrl.getChart().getImage();
     }
     else
     {
         if (ctrl.getChart().make(m_collRows[indexRows].Rows, ctrl.getLabel().getAspect().getFormat(), false, ""))
         {
             return ctrl.getChart().getImage();
         }
         else
         {
             return null;
         }
     }
 }