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 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 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()); }
// indexRows define the datasource // indexRow define the row in the datasource // private void pGetIndexRows(out int indexRows, out int indexRow, out int indexField, cReportControl ctrl) { // the datasource index have an offset of 1000 between each other // indexRows = (int)(ctrl.getField().getIndex() / 1000); indexField = ctrl.getField().getIndex() - (indexRows * 1000); if (indexRows == 0) { indexRow = m_vRowsIndex[m_iRow2]; } else { indexRow = m_vRowsIndexAux[indexRows]; } }