Package net.sf.jasperreports.engine.data

Examples of net.sf.jasperreports.engine.data.JRTableModelDataSource


    //Preparing parameters
    Map parameters = new HashMap();
    parameters.put("ReportTitle", "Address Report");
    parameters.put("DataFile", "CustomTableModel.java");

    JasperFillManager.fillReportToFile("build/reports/DataSourceReport.jasper", parameters, new JRTableModelDataSource(new CustomTableModel()));
    System.err.println("Filling time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here


   * @throws ProTransException
   */
  public final void generateProtransReport(final TableModel tableModel,
      final String heading, final ReportEnum reportEnum,
      final Map<String, Object> extraParams) throws ProTransException {
    generateProtransReportFromDatasource(new JRTableModelDataSource(
        tableModel), heading, reportEnum, extraParams);
  }
View Full Code Here

        final String[] legendColumns = {NAME_COLUMN, ICON_COLUMN, LEVEL_COLUMN};
        final LegendAttributeValue legendAttributes = values.legend;
        fillLegend(values.clientHttpRequestFactory, legendAttributes, legendList, 0, context);
        final Object[][] legend = new Object[legendList.size()][];

        final JRTableModelDataSource dataSource = new JRTableModelDataSource(new TableDataSource(legendColumns,
                legendList.toArray(legend)));

        String compiledTemplatePath = compileTemplate(values.template.getConfiguration());

        return new Output(dataSource, legendList.size(), compiledTemplatePath);
View Full Code Here

        final Template template = config.getTemplate("main");
        PJsonObject requestData = loadJsonRequestData();
        Values values = new Values(requestData, template, parser, getTaskDirectory(), this.httpRequestFactory, new File("."));
        forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        final JRTableModelDataSource legend = values.getObject("legend", JRTableModelDataSource.class);

        int count = 0;
        while (legend.next()) {
            count++;
        }

        assertEquals(9, count);
    }
View Full Code Here

      putFields(topFields, param);
    }
    if (bottomFields != null){
      putFields(bottomFields, param);
    }
    param.put(JRParameter.REPORT_DATA_SOURCE, new JRTableModelDataSource(model));
    return param;
  }
View Full Code Here

   * @param params - параметры будущего отчета
   */
  void initTableParams(HashMap<String, Object> params, boolean isAutoGenerated) throws ClipsException{
    initFieldParams(params, isAutoGenerated);
    if (table != null) {
      params.put(JRParameter.REPORT_DATA_SOURCE, new JRTableModelDataSource(table));
   
    params.putAll(getLoader().getDefaultParameters());
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.data.JRTableModelDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.