Package net.sf.jasperreports.engine.data

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


  }

  protected JasperPrint geraRelatorio(){
    try{
      if(relatorio == null){
        JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(Arrays.asList(boletos));
        relatorio = JasperFillManager.fillReport(templateJasper,parametros,  dataSource);
      }
      return relatorio;
    }catch(Exception e){
      throw new GeracaoBoletoException(e);
View Full Code Here


  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, JRDataSource ds) throws JRException {
        return generateJasperPrint(dr, layoutManager, ds, new HashMap());
    }

  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Collection collection) throws JRException {
    JRDataSource ds = new JRBeanCollectionDataSource(collection);
    return generateJasperPrint(dr, layoutManager, ds, new HashMap());
  }
View Full Code Here

    public void setListOfUser(List<User> listOfUser) {
        this.listOfUser = listOfUser;
    }
    JasperPrint jasperPrint;
    public void init() throws JRException{
        JRBeanCollectionDataSource beanCollectionDataSource=new JRBeanCollectionDataSource(listOfUser);
        jasperPrint=JasperFillManager.fillReport("C:\\Users\\ramki\\Desktop\\report.jasper", new HashMap(),beanCollectionDataSource);
    }
View Full Code Here

      super(clazz);
    }

    @Override
    public JRDataSource create(JasperReport jasperReport) throws JRException {
      return new JRBeanCollectionDataSource(getData());
    }
View Full Code Here

  }

  protected Map<String, Object> getModel() {
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("ReportTitle", "Dear Lord!");
    model.put("dataSource", new JRBeanCollectionDataSource(getData()));
    extendModel(model);
    return model;
  }
View Full Code Here

  public static JRDataSource convertReportData(Object value) throws IllegalArgumentException {
    if (value instanceof JRDataSource) {
      return (JRDataSource) value;
    }
    else if (value instanceof Collection) {
      return new JRBeanCollectionDataSource((Collection<?>) value);
    }
    else if (value instanceof Object[]) {
      return new JRBeanArrayDataSource((Object[]) value);
    }
    else {
View Full Code Here

    List fieldsList = reportData.getFieldsList();
    if (G4Utils.isEmpty(fieldsList)) {
      jasperPrint = JasperFillManager.fillReport(jasperReport, reportData.getParametersDto(),
          new JREmptyDataSource());
    } else {
      JRBeanCollectionDataSource jRDataSource = new JRBeanCollectionDataSource(fieldsList);
      jasperPrint = JasperFillManager.fillReport(jasperReport, reportData.getParametersDto(), jRDataSource);
    }
    return jasperPrint;
  }
View Full Code Here

  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, JRDataSource ds) throws JRException {
        return generateJasperPrint(dr, layoutManager, ds, new HashMap());
    }

  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Collection collection) throws JRException {
    JRDataSource ds = new JRBeanCollectionDataSource(collection);
    return generateJasperPrint(dr, layoutManager, ds, new HashMap());
  }
View Full Code Here

  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, JRDataSource ds) throws JRException {
        return generateJasperPrint(dr, layoutManager, ds, new HashMap());
    }

  public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Collection collection) throws JRException {
    JRDataSource ds = new JRBeanCollectionDataSource(collection);
    return generateJasperPrint(dr, layoutManager, ds, new HashMap());
  }
View Full Code Here

    return print;
  }
 
  private JRDataSource getDataSource(Report report) {
    if (report.getData() != null)
      return new JRBeanCollectionDataSource(report.getData(), false);
    else {
      logger.warn("You are willing to generate a report, but there is no valid datasource, using empty one");
      return new JREmptyDataSource();
    }
  }
View Full Code Here

TOP

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

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.