protected void onBtnRemoveReportClick() throws ims.framework.exceptions.PresentationLogicException { if (form.grdReportsToPrint().getValue() == null || !(form.grdReportsToPrint().getValue() instanceof TemplatePrinterVo)) { engine.showMessage("Please select a template !"); return; } PrintAgentVo agent = form.getLocalContext().getJobSettings(); TemplatePrinterVo repTemplate = (TemplatePrinterVo) form.grdReportsToPrint().getValue(); for (int i = 0; i < agent.getTemplatesToPrint().size(); i++) { TemplatePrinterVo tp = agent.getTemplatesToPrint().get(i); if (tp.getTemplate().getID_TemplateBo().equals(repTemplate.getTemplate().getID_TemplateBo())) { agent.getTemplatesToPrint().remove(tp); form.getLocalContext().setJobSettings(agent); break; } } displayAvailableReports(form.getLocalContext().getReportsAvailable(), agent); displaySelectedTemplates(agent); }
private void displaySelectedTemplates(PrintAgentVo agent) { form.grdReportsToPrint().getRows().clear(); if (agent == null || agent.getTemplatesToPrintIsNotNull() == false) return; for (int i = 0; i < agent.getTemplatesToPrint().size(); i++) { TemplatePrinterVo tp = agent.getTemplatesToPrint().get(i); grdReportsToPrintRow parentRow = getParentRowById(tp.getTemplate().getReport()); if (parentRow == null) { ReportVo rep = tp.getTemplate().getReport(); parentRow = form.grdReportsToPrint().getRows().newRow(); parentRow.setColumnReport(rep.getReportName()); parentRow.setTooltip(rep.getReportDescription()); parentRow.setBold(true); parentRow.setBackColor(Color.Beige); parentRow.setValue(rep); parentRow.setExpanded(true); } grdReportsToPrintRow child = parentRow.getRows().newRow(); child.setColumnReport(tp.getTemplate().getName()); child.setColumnPrintTo(tp.getPrinterName()); child.setColumnPrintToReadOnly(false); child.setTooltip(tp.getTemplate().getDescription()); child.setValue(tp); } }
protected void onGrdReportsToPrintGridComboBoxSelectionChanged(int column, grdReportsToPrintRow row, Object value) throws PresentationLogicException { TemplatePrinterVo tp = (TemplatePrinterVo) row.getValue(); tp.setPrinterName((String) value); }