// we modify the report data source so it uses the CSReportWebServer instead of a real sql engine (SqlServer, PostgreSQL or Oracle) // public void init(JObject request) { m_webReportId = request["message"]["webReportId"].ToString(); m_reportId = Guid.NewGuid().ToString(); m_database = Guid.NewGuid().ToString(); m_report = new cReport(); m_report.setDatabaseEngine(csDatabaseEngine.CSREPORT_WEB); m_report.Progress += reportProgress; m_report.ReportDone += reportDone; cReportLaunchInfo oLaunchInfo = new cReportLaunchInfo(); oLaunchInfo.setPrinter(cPrintAPI.getcPrinterFromDefaultPrinter(null)); registerDataSource(request); if (!m_report.init(oLaunchInfo)) { return; } m_report.setPathDefault(Application.StartupPath); }
/* TODO: implement me private void form_QueryUnload(int cancel, int unloadMode) { cancel = !saveChanges(); if (cancel) { cGlobals.setDocActive(this); } } */ /* TODO: implement me private void form_Unload(int cancel) { if (m_fmain.getReportCopySource() == this) { m_fmain.setReportCopySource(null); } if (fSearch.fSearch.getFReport() == this) { fSearch.fSearch.setFReport(null); } m_report = null; m_paint = null; m_fToolBox = null; m_fControls = null; m_fTreeCtrls = null; m_fConnectsAux = null; m_fProperties = null; m_fFormula = null; m_fGroup = null; m_fProgress.Hide(); m_fProgress = null; cGlobals.setDocInacActive(this); G.redim(ref m_vSelectedKeys, 0); G.redim(ref m_vCopyKeys, 0); } */ public void init() { m_showingProperties = false; cReportLaunchInfo oLaunchInfo = null; m_report = new cReport(); // TODO: event handler for // /* m_report_Done(); m_report_Progress(task, page, currRecord, recordCount, cancel,); m_report_FindFileAccess(answer, commDialog, file,); */ oLaunchInfo = new cReportLaunchInfo(); m_report.getPaperInfo().setPaperSize(m_fmain.getPaperSize()); m_report.getPaperInfo().setOrientation(m_fmain.getOrientation()); oLaunchInfo.setPrinter(cPrintAPI.getcPrinterFromDefaultPrinter()); oLaunchInfo.setObjPaint(new CSReportPaint.cReportPrint()); if (!m_report.init(oLaunchInfo)) { return; } CSKernelFile.cFile file = new CSKernelFile.cFile(); m_report.setPathDefault(Application.StartupPath); m_picReport.Top = C_TOPBODY; m_picRule.Left = 0; m_picReport.Left = pGetLeftBody(); m_keyMoving = ""; m_keySizing = ""; m_keyObj = ""; m_keyFocus = ""; m_nextNameCtrl = 0; m_paint = new CSReportPaint.cReportPaint(); Rectangle tR = null; cReportPaperInfo w_paperInfo = m_report.getPaperInfo(); tR = new Rectangle(CSReportPaint.cGlobals.getRectFromPaperSize( m_report.getPaperInfo(), w_paperInfo.getPaperSize(), w_paperInfo.getOrientation())); cGlobals.createStandarSections(m_report, tR); m_paint.setGridHeight(pSetSizePics(tR.height)); m_paint.initGrid(m_picReport.CreateGraphics(), m_typeGrid); paintStandarSections(); m_dataHasChanged = false; }
public void newReport(cReport report) { if (report != null) { m_report = report; reLoadReport(); pValidateSectionAspect(); reLoadReport(); } else { m_paint.createPicture(m_graphic); refreshRule(); } Application.DoEvents(); cGlobals.setDocActive(this); }
/* TODO: implement me private void form_QueryUnload(int cancel, int unloadMode) { cancel = !saveChanges(); if (cancel) { cGlobals.setDocActive(this); } } */ /* TODO: implement me private void form_Unload(int cancel) { if (m_fmain.getReportCopySource() == this) { m_fmain.setReportCopySource(null); } if (fSearch.fSearch.getFReport() == this) { fSearch.fSearch.setFReport(null); } m_report = null; m_paint = null; m_fToolBox = null; m_fControls = null; m_fTreeCtrls = null; m_fConnectsAux = null; m_fProperties = null; m_fFormula = null; m_fGroup = null; m_fProgress.Hide(); m_fProgress = null; cGlobals.setDocInacActive(this); G.redim(ref m_vSelectedKeys, 0); G.redim(ref m_vCopyKeys, 0); } */ public void init() { m_showingProperties = false; cReportLaunchInfo oLaunchInfo = null; m_report = new cReport(); // TODO: event handler for // /* m_report_Done(); m_report_Progress(task, page, currRecord, recordCount, cancel,); m_report_FindFileAccess(answer, commDialog, file,); */ m_report.Progress += reportProgress; m_report.ReportDone += reportDone; oLaunchInfo = new cReportLaunchInfo(); m_report.getPaperInfo().setPaperSize(m_fmain.getPaperSize()); m_report.getPaperInfo().setOrientation(m_fmain.getOrientation()); oLaunchInfo.setPrinter(cPrintAPI.getcPrinterFromDefaultPrinter(m_fmain.printDialog)); oLaunchInfo.setObjPaint(new cReportPrint()); if (!m_report.init(oLaunchInfo)) { return; } m_report.setPathDefault(Application.StartupPath); m_picReport.Top = C_TOPBODY; m_picRule.Left = 0; m_picReport.Left = pGetLeftBody(); m_keyMoving = ""; m_keySizing = ""; m_keyObj = ""; m_keyFocus = ""; m_nextNameCtrl = 0; m_paint = new cReportPaint(); Rectangle tR = null; cReportPaperInfo w_paperInfo = m_report.getPaperInfo(); tR = new Rectangle(CSReportPaint.cGlobals.getRectFromPaperSize( m_report.getPaperInfo(), w_paperInfo.getPaperSize(), w_paperInfo.getOrientation())); cGlobals.createStandarSections(m_report, tR); reLoadReport(); }
public void newReport(cReport report) { m_isNew = true; if (report != null) { m_report = report; pValidateSectionAspect(); reLoadReport(); } else { m_report.setName("New report"); m_paint.createPicture(m_picReport.CreateGraphics()); refreshRule(); } cMainEditor.setDocActive(this); }
public void addCtrls(cReport report) { cGlobals.addCtrls(report, lv_controls, C_CTRL_IMAGE, C_DB_IMAGE); }
internal void setReport(cReport rhs) { m_report = rhs; }
public void addCtrls (cReport m_report) { throw new NotImplementedException (); }
public static void addCtrls( cReport report, TreeView tv_controls, int C_IMG_FOLDER, int C_IMG_FORMULA, int C_IMG_CONTROL, int C_IMG_DATBASE_FIELD) { tv_controls.Nodes.Clear(); TreeNode nodeGroup; TreeNode nodeRoot = tv_controls.Nodes.Add(report.getName()); nodeRoot.ImageIndex = C_IMG_FOLDER; nodeGroup = nodeRoot.Nodes.Add("Headers"); nodeGroup.ImageIndex = C_IMG_FOLDER; pAddCtrlsAux(report.getHeaders(), nodeGroup, C_IMG_FOLDER, C_IMG_FORMULA, C_IMG_CONTROL, C_IMG_DATBASE_FIELD); nodeGroup = nodeRoot.Nodes.Add("Group Header"); nodeGroup.ImageIndex = C_IMG_FOLDER; pAddCtrlsAux(report.getGroupsHeaders(), nodeGroup, C_IMG_FOLDER, C_IMG_FORMULA, C_IMG_CONTROL, C_IMG_DATBASE_FIELD); nodeGroup = nodeRoot.Nodes.Add("Details"); nodeGroup.ImageIndex = C_IMG_FOLDER; pAddCtrlsAux(report.getDetails(), nodeGroup, C_IMG_FOLDER, C_IMG_FORMULA, C_IMG_CONTROL, C_IMG_DATBASE_FIELD); nodeGroup = nodeRoot.Nodes.Add("Group Footer"); nodeGroup.ImageIndex = C_IMG_FOLDER; pAddCtrlsAux(report.getGroupsFooters(), nodeGroup, C_IMG_FOLDER, C_IMG_FORMULA, C_IMG_CONTROL, C_IMG_DATBASE_FIELD); nodeGroup = nodeRoot.Nodes.Add("Footers"); nodeGroup.ImageIndex = C_IMG_FOLDER; pAddCtrlsAux(report.getFooters(), nodeGroup, C_IMG_FOLDER, C_IMG_FORMULA, C_IMG_CONTROL, C_IMG_DATBASE_FIELD); nodeRoot.ExpandAll(); }
public static void addCtrls(cReport report, ListView lv_controls, int C_CTRL_IMAGE, int C_DB_IMAGE) { lv_controls.Items.Clear(); for (int i = 0; i < report.getControls().count(); i++) { var ctrl = report.getControls().item(i); var ctrlName = ctrl.getName(); var ctrlInfo = ""; var ctrlField = ""; switch (ctrl.getControlType()) { case csRptControlType.CSRPTCTFIELD: ctrlField = ctrl.getField().getName(); break; case csRptControlType.CSRPTCTDBIMAGE: ctrlInfo = ctrl.getField().getName(); break; case csRptControlType.CSRPTCTIMAGE: ctrlInfo = " (Image)"; break; case csRptControlType.CSRPTCTLABEL: ctrlInfo = ctrl.getLabel().getText(); break; } if (ctrlInfo.Length > 0) { ctrlName += " (" + ctrlInfo + ")"; } var item = lv_controls.Items.Add(ctrlName, C_CTRL_IMAGE); item.Tag = ctrl.getKey(); item.SubItems.Add(""); item.SubItems.Add(""); item.SubItems.Add(""); if (ctrl.getHasFormulaValue()) item.SubItems[1].Text = "*"; if (ctrl.getHasFormulaHide()) item.SubItems[2].Text = "*"; if (ctrlField.Length > 0) { item.SubItems[3].Text = ctrlField; item.SubItems[3].ForeColor = Color.Blue; item.ImageIndex = C_DB_IMAGE; } if (ctrl.getName().Length > 4 && ctrl.getName().Substring(0, 4) == "lnk_") { item.ForeColor = Color.Red; } } }
internal static void createStandarSections(cReport report, Rectangle tr) { report.getHeaders().add(null, C_KEY_HEADER); report.getFooters().add(null, C_KEY_FOOTER); report.getDetails().add(null, C_KEY_DETAIL); // // main header // cReportSection sec = report.getHeaders().item(C_KEY_HEADER); sec.setName("Main header"); cReportAspect aspect = sec.getAspect(); aspect.setTop(0); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); cReportSectionLine secLn = sec.getSectionLines().item(0); secLn.setSectionName("Main header"); aspect = secLn.getAspect(); aspect.setTop(0); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); // // detail // sec = report.getDetails().item(C_KEY_DETAIL); sec.setName("Detail"); aspect = sec.getAspect(); aspect.setTop(tr.height * 0.25f); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); secLn = sec.getSectionLines().item(0); secLn.setSectionName("Detail"); aspect = secLn.getAspect(); aspect.setTop(tr.height * 0.25f); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); // // main footer // sec = report.getFooters().item(C_KEY_FOOTER); sec.setName("Main footer"); aspect = sec.getAspect(); aspect.setTop(tr.height * 0.75f); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); secLn = sec.getSectionLines().item(0); secLn.setSectionName("Main footer"); aspect = secLn.getAspect(); aspect.setTop(tr.height * 0.75f); aspect.setHeight(tr.height * 0.25f); aspect.setWidth(tr.width); }
public void setReport(object rhs) { m_report = (CSReportDll.cReport)rhs; }
public void Dispose() { m_report = null; m_paint = null; if (m_fPreview != null) { m_fPreview.Dispose(); } m_rpwPrint = null; }
private void setReport(CSReportDll.cReport rhs) { m_report = rhs; }
internal static void createStandarSections(cReport report, Rectangle tr) { throw new NotImplementedException(); }