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()); }
private void pAddSectionLinesAux( cReportSection sec, CSReportPaint.cReportPaintObject paintObj) { csRptTypeSection typeSecLn = csRptTypeSection.CONTROL; cReportAspect aspect = null; int maxBottom = 0; int minBottom = 0; int index = 0; float y = 0; switch (sec.getTypeSection()) { case csRptTypeSection.CSRPTTPSCHEADER: case csRptTypeSection.CSRPTTPMAINSECTIONHEADER: pMoveHeader(sec.getKey(), minBottom, maxBottom, false); aspect = sec.getAspect(); y = aspect.getHeight() + aspect.getTop(); typeSecLn = csRptTypeSection.C_KEY_SECLN_HEADER; index = sec.getSectionLines().count() - 1; break; case csRptTypeSection.CSRPTTPSCDETAIL: case csRptTypeSection.CSRPTTPMAINSECTIONDETAIL: pMoveDetails(sec.getKey(), minBottom, maxBottom, false); aspect = sec.getAspect(); y = aspect.getHeight() + aspect.getTop(); typeSecLn = csRptTypeSection.C_KEY_SECLN_DETAIL; index = sec.getSectionLines().count() - 1; break; case csRptTypeSection.CSRPTTPGROUPHEADER: pMoveGroupHeader(sec.getKey(), minBottom, maxBottom, false); aspect = sec.getAspect(); y = aspect.getHeight() + aspect.getTop(); typeSecLn = csRptTypeSection.C_KEY_SECLN_GROUPH; index = sec.getSectionLines().count() - 1; break; case csRptTypeSection.CSRPTTPGROUPFOOTER: pMoveGroupFooter(sec.getKey(), minBottom, maxBottom, false); aspect = sec.getAspect(); y = aspect.getHeight() + aspect.getTop(); typeSecLn = csRptTypeSection.C_KEY_SECLN_GROUPF; index = sec.getSectionLines().count() - 1; break; case csRptTypeSection.CSRPTTPSCFOOTER: case csRptTypeSection.CSRPTTPMAINSECTIONFOOTER: aspect = sec.getAspect(); aspect.setTop(aspect.getTop() - cGlobals.C_HEIGHT_NEW_SECTION); pMoveFooter(sec.getKey(), minBottom, maxBottom, false); m_offY = 0; y = aspect.getHeight() + aspect.getTop() - m_offSet - cGlobals.C_HEIGHT_BAR_SECTION; typeSecLn = csRptTypeSection.C_KEY_SECLN_FOOTER; index = 1; break; } // we add a paint object to all sectionlines except the last one // the last sectionline uses the paint object of the section // cReportSectionLine secL = sec.getSectionLines().item(index); secL.setKeyPaint( paintSection(secL.getAspect(), secL.getKey(), sec.getTypeSection(), C_SECTIONLINE + (sec.getSectionLines().count() - 1).ToString(), true)); // section line CSReportPaint.cReportPaintObject po = m_paint.getPaintSections().item(secL.getKeyPaint()); po.setRptType(typeSecLn); po.setRptKeySec(sec.getKey()); // section po = m_paint.getPaintSections().item(sec.getKeyPaint()); po.setTextLine(C_SECTIONLINE + sec.getSectionLines().count().ToString()); moveSection(paintObj, 0, y, minBottom, maxBottom, sec, false); refreshBody(); refreshRule(); }
private void moveSection(CSReportPaint.cReportPaintObject paintObj, float x, float y, float minBottom, float maxBottom, cReportSection secToMove, bool isNew) { float oldHeight = 0; int i = 0; m_dataHasChanged = true; cReportAspect w_aspect = paintObj.getAspect(); // if Y is contained by the premited range everything is ok // if (y >= minBottom && y <= maxBottom) { w_aspect.setTop(y - m_offY); // because the top has been set to real dimensions // of the screen we must move to the offset // of his section // w_aspect.setTop(w_aspect.getTop() + w_aspect.getOffset()); } else { // if we have moved to top // if (y < minBottom) { w_aspect.setTop(minBottom); // because the top has been set to real dimensions // of the screen we must move to the offset // of his section // w_aspect.setTop(w_aspect.getTop() + w_aspect.getOffset()); } else { w_aspect.setTop(maxBottom); } } m_paint.alingToGrid(paintObj.getKey()); if (isNew) { oldHeight = 0; } else { oldHeight = secToMove.getAspect().getHeight(); } // for the detail section and every other section which is over the detail // we only change the height, for all sections bellow the detail we need to // change the height and top becasuse wen we strech a section it needs to move // to the bottom of the report // secToMove.getAspect().setHeight(w_aspect.getTop() + cGlobals.C_HEIGHT_BAR_SECTION - secToMove.getAspect().getTop()); // every section bellow this section needs to update its top // float offsetTop = 0; w_aspect = secToMove.getAspect(); offsetTop = oldHeight - (w_aspect.getHeight() + m_newSecLineOffSet); switch (secToMove.getTypeSection()) { // if the section is a footer we move to bottom // (Ojo footer sections, no group footers) // case csRptTypeSection.CSRPTTPSCFOOTER: case csRptTypeSection.CSRPTTPMAINSECTIONFOOTER: w_aspect.setTop(w_aspect.getTop() + offsetTop); // OJO: this has to be after we have changed the top of the section // to allow the paint object to reflect the change // // we move the controls of this section // pChangeHeightSection(secToMove, oldHeight); // move the section // pChangeBottomSections(secToMove, offsetTop); // for headers, group headers, group footers and the detail section we move to top // break; default: // move all controls in this section // pChangeHeightSection(secToMove, oldHeight); offsetTop = offsetTop * -1; pChangeTopSections(secToMove, offsetTop); break; } // finaly we need to update the offset of every section, // apply it to every object paint in m_Paint // float pageHeight = 0; cReportPaperInfo w_paperInfo = m_report.getPaperInfo(); pGetOffSet(CSReportPaint.cGlobals.getRectFromPaperSize( m_report.getPaperInfo(), w_paperInfo.getPaperSize(), w_paperInfo.getOrientation()).Height, pageHeight); pRefreshOffSetInPaintObjs(); m_paint.setGridHeight(pageHeight); }
public void showGrid(CSReportPaint.csETypeGrid typeGrid) { m_typeGrid = typeGrid; m_paint.initGrid(m_picReport.CreateGraphics(), typeGrid); }