public WOComponent componentToEmail() { System.out.println("ReportListWrapper.componentToEmail()"); WOComponent comp = null; if (isList() == true) { comp = (WOComponent) pageWithName("ItemList"); comp.takeValueForKey(displayGroup, "itemDisplayGroup"); ((ItemList) comp) .displayAll(); // no batching in emails - how to return it to original setting? ((ItemList) comp) .setEmailFlag( true); // set a flag for emails to hide any content that does not display properly ((ItemList) comp).setCommentsFlag(commentsFlag); ((ItemList) comp).setReleaseFlag(releaseFlag); } else if (isReport() == true) { comp = (ReportGenerator) pageWithName("ReportGenerator"); // ((ReportGenerator)comp).setNeedUpdate(true); comp.takeValueForKey(aColumn, "selectedColumn"); comp.takeValueForKey(aRow, "selectedRow"); comp.takeValueForKey(displayGroup, "displayGroup"); ((ReportGenerator) comp).setHideReportSpecifier(true); ((ReportGenerator) comp).setHideGraphLink(true); } /* else if(isEstimate() == true) { comp = (WOComponent)pageWithName("EstimateActual"); comp.takeValueForKey(displayGroup, "displayGroup"); ((EstimateActual)comp).setIsSelected(false); ((EstimateActual)comp).setShowLinks(false); } */ return (WOComponent) comp; }
private void write(BufferedReader input, DataOutputStream output, Client client) throws IOException { path = reportGenerator.getPath(client); try { output.writeBytes(requestHeader(200, 5)); reportGenerator.generate(path, output); } catch (Exception e) { output.writeBytes(requestHeader(404, 5)); } output.close(); }
private void generateReport() { progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(reportGeneratorTask.progressProperty()); new Thread(reportGeneratorTask).start(); reportGeneratorTask.addEventHandler( WorkerStateEvent.WORKER_STATE_SUCCEEDED, new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent t) { setCenter(reportGeneratorTask.getValue()); } }); }
public void generateMonthlyReport(int year, int month) { String[][] statistics = null; // // Gather month-end data // reportGenerator.generate(statistics); }
public void generateDailyReport(int year, int month, int day) { String[][] statistics = null; // // Gather daily data // reportGenerator.generate(statistics); }
public void generateAnnualReport(int year) { String[][] statistics = null; // // Gather year-end data // reportGenerator.generate(statistics); }
@Override public final void execute() throws MojoExecutionException, MojoFailureException { LOGGER.debug("starting report execution..."); MojoLogAppender.beginLogging(this); try { ReportGenerator.extractJSDocToolkit(getToolkitExtractDirectory()); Set<File> sourceFiles = getSourceFiles(); List<String> args = createArgumentStack(sourceFiles); ReportGenerator.executeJSDocToolkit( getJsDocAppLocation(), args, getToolkitExtractDirectory()); } catch (Exception e) { LOGGER.error("There was an error in the execution of the report: " + e.getMessage(), e); throw new MojoExecutionException(e.getMessage(), e); } finally { MojoLogAppender.endLogging(); } }
@Override public void addDisplayEntity(DisplayEntity ent) { super.addDisplayEntity(ent); // Log the entity's outputs file.format("%n"); logTime = this.getSimTime(); ReportGenerator.printOutputs(file, ent, logTime); // Log the entity's states if (ent instanceof StateEntity) ReportGenerator.printStates(file, (StateEntity) ent); // Empty the output buffer file.flush(); // Send the entity to the next element in the chain this.sendToNextComponent(ent); }
void generateReport(final ReportGenerator rGen) { rGen.setTemplate(properties.getProperty("Template File")); rGen.setProperties(properties); final Collection<TableColumnModel> columnModels = new ArrayList<TableColumnModel>(); for (JTable table : tables) { columnModels.add(table.getColumnModel()); } rGen.setTableData( jpc.getModel(), jpc.getUberSelection(), TableUtils.combineColumnModels(columnModels)); final TableModel imageTableModel = imageTable.getModel(); final List<JComponent> comps = new ArrayList<JComponent>(); for (int row = 0; row < imageTableModel.getRowCount(); row++) { if (imageTableModel.getValueAt(row, 3) == Boolean.TRUE) { comps.add((JComponent) imageTableModel.getValueAt(row, 0)); } } rGen.setComponentsToAppend(comps); rGen.populateTemplate(); }
protected void doExport( Context context, String tableName, String[] cellContent, String[] cellHeaders) { ReportGenerator reportGenerator; reportGenerator = new ReportGenerator(context, tableName, cellContent, cellHeaders); reportGenerator.execute(); }
/** * Tests if report can be generated without errors. The {@link SinkStub} stubs the {@link Sink} * class. * * @throws MavenReportException */ public void testDoGenerateReport() throws MavenReportException { ReportConfigStub config = new ReportConfigStub(); List plugins = Collections.singletonList(new ChronosHistogramPlugin(samples)); ReportGenerator gen = new ReportGenerator(bundle, config, new GraphGenerator(plugins)); gen.doGenerateReport(new SinkStub(), samples); }
private String requestHeader(int return_code, int file_type) { String s = reportGenerator.statusCode(return_code); s = reportGenerator.contentType(5, s); return s; }
public boolean getReport(BillManagementPO po) { ReportGenerator gen = new ReportGenerator(); return gen.createBillReport(po); }
/** * Expects the following servlet params: type,format,session,start,end,criterion,groupByCriterion * * <p>Type, format, criterion, and groupByCriterion are taken from the enums: ReportType, * ReportFormat, and ReportingCriterion. GroupByCriterion can also have the value "None". Start * and end are in milliseconds. Session is a session id string. */ @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { User user = this.getUserFromSession(Param.session.getRaw(req)); if (user == null) { throw new RuntimeException("User was null"); } /* Parse all params */ final String reportType = Param.type.get(req); final ReportFormat format = ReportFormat.valueOf(Param.format.get(req)); final long start = Long.parseLong(Param.start.get(req)); final long end = Long.parseLong(Param.end.get(req)); final Period period = new Period(start, end); final ReportingCriterion criterion = ReportingCriterion.valueOf(Param.criterion.get(req)); final Units displayUnits = Units.getDefaultDisplayUnits(); ReportingCriterion groupByCriterion = null; // GroupByCriterion can optionally have value "None"; check for it String groupByParam = req.getParameter(Param.groupByCriterion.name()); if (groupByParam != null && !groupByParam.equalsIgnoreCase("NONE")) { groupByCriterion = ReportingCriterion.valueOf(Param.groupByCriterion.get(req)); } LOG.info( String.format( "Params: type:%s format:%s period:%s" + "criterion:%s groupBy:%s", reportType, format, period, criterion, groupByCriterion)); /* Set servlet response content type, etc, based upon report format. */ setContentTypeHeader(res, format, Param.type.get(req)); /* Generate the report and send it thru the OutputStream */ if (user.isSystemAdmin()) { // Generate report of all accounts ReportGenerator.getInstance() .generateReport( reportType, format, period, criterion, groupByCriterion, displayUnits, res.getOutputStream(), null); } else if (user.isAccountAdmin()) { String accountId; try { accountId = user.getAccount().getAccountNumber(); } catch (AuthException aex) { throw new RuntimeException("Auth failed"); } // Generate report of this account only ReportGenerator.getInstance() .generateReport( reportType, format, period, criterion, groupByCriterion, displayUnits, res.getOutputStream(), accountId); } else { throw new RuntimeException("Only admins and account owners can generate reports"); } }