Examples of JRBeanCollectionDataSource


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

    public InputStream generateGridReport(String docType, GridDTO data) {
        try {
            FastReportBuilder reportBuilder = new FastReportBuilder();
            reportBuilder.setTitle("IWebMvc - Sample Grid Report").setSubtitle("Generated at " + new Date()).setUseFullPageWidth(true);
            for (String column : data.getColumns()) reportBuilder.addColumn(column, column, String.class.getName(), 1);
            JRDataSource ds = new JRBeanCollectionDataSource(data.getData(), false);
            JasperPrint jp = DynamicJasperHelper.generateJasperPrint(reportBuilder.build(), new ClassicLayoutManager(), ds);
            return "EXCEL".equals(docType) ? exportToExcel(jp) : exportToPDF(jp);
        } catch (Exception e) {
            throw new IWebMvcException("Error building grid report", e);
        }
View Full Code Here

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

    //Preparing parameters
    Map parameters = new HashMap();
    parameters.put("ReportTitle", "Address Report");
    parameters.put("DataFile", "CustomBeanFactory.java - Bean Collection");

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

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

 
 
 
  @RequestMapping(method = RequestMethod.GET)
  public String fireReport(@ModelAttribute("formatUtil") @Valid FormatUtil formatUtil,BindingResult result,ModelMap modelMap,Model model,HttpServletRequest request) {
    JRBeanCollectionDataSource jrDataSource = new JRBeanCollectionDataSource(reportsService.getReports(),false);
    modelMap.put("format",formatUtil.getFormat());
    modelMap.put("reportList", jrDataSource);
    return "reportList";
   }
View Full Code Here

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

  public final void generateProtransReportFromBean(final Collection<?> beans,
      final String heading, final ReportEnum reportEnum,
      final Map<String, Object> extraParams, final String reportFileName)
      throws ProTransException {
    fileName = reportFileName;
    generateProtransReportFromDatasource(new JRBeanCollectionDataSource(
        beans), heading, reportEnum, extraParams);
  }
View Full Code Here

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

  @Override
  public byte[] gerarExtrato(ExtratoDTO extratoDTO) {
    if(extratoDTO == null)
      throw new IllegalArgumentException("Extrato DTO nulo");

    JRBeanCollectionDataSource jrBeanCollectionDataSource =
        new JRBeanCollectionDataSource(extratoDTO.getItensExtrato());
   
    try {

      JasperPrint  jasperPrint =
        JasperFillManager.fillReport(
View Full Code Here

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

    if (exportType == ExportType.PDF) jasperDesign.setColumnHeader(bandHeader);
    jasperDesign.setDetail(bandDetail);
   
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,
        new JRBeanCollectionDataSource(results));

    return jasperPrint;
 
View Full Code Here

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

*/
public class BeanCollections {

    public static JRDataSource getJRDataSourceFromBeans(List<ReportDataManager> reportDataList) {

        return new JRBeanCollectionDataSource(reportDataList);

    }
View Full Code Here

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

*/
public class BeanCollections {

    public static JRDataSource getJRDataSourceFromBeans(List<ReportDataManager> reportDataList) {

        return new JRBeanCollectionDataSource(reportDataList);

    }
View Full Code Here

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

            ReportResourceSupplierClient resourceSupplierClient = new ReportResourceSupplierClient(cookie,
                    serverURL, configurationContext);

            List<ReportDataManager> reportDataList = (List<ReportDataManager>) reportDataObject;
            String reportResource = resourceSupplierClient.getReportResources(component, template);
            JRDataSource jrDataSource = new JRBeanCollectionDataSource(reportDataList);
            JasperPrintProvider jasperPrintProvider = new JasperPrintProvider();
            JasperPrint jasperPrint = jasperPrintProvider.createJasperPrint(jrDataSource ,reportResource, new ReportParamMap[0]);
            request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,jasperPrint);
            ReportStream reportStream = new ReportStream();
            ByteArrayOutputStream outputStream =  reportStream.getReportStream(jasperPrint,generateType);
View Full Code Here

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

            ReportResourceSupplierClient resourceSupplierClient = new ReportResourceSupplierClient(cookie,
                    serverURL, configurationContext);

            List<ReportDataManager> reportDataList = (List<ReportDataManager>) reportDataObject;
            String reportResource = resourceSupplierClient.getReportResources(component, template);
            JRDataSource jrDataSource = new JRBeanCollectionDataSource(reportDataList);
            JasperPrintProvider jasperPrintProvider = new JasperPrintProvider();
            JasperPrint jasperPrint = jasperPrintProvider.createJasperPrint(jrDataSource ,reportResource, new ReportParamMap[0]);
            request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,jasperPrint);
            ReportStream reportStream = new ReportStream();
            ByteArrayOutputStream outputStream =  reportStream.getReportStream(jasperPrint,type);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.