Package ar.com.fdvs.dj.core.layout

Examples of ar.com.fdvs.dj.core.layout.ClassicLayoutManager


        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


      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

    // get the styles
    DJReportStyles djrst = getDjReportStyles();

    DynamicReport drHeaderSubreport = new DJLetterHead();
    drbContent.addSubreportInGroupHeader(1, drHeaderSubreport, new ClassicLayoutManager(), "", DJConstants.DATA_SOURCE_ORIGIN_FIELD, DJConstants.DATA_SOURCE_TYPE_COLLECTION);

    // Sets the Report Columns, header, Title, Groups, Etc Formats
    // DynamicJasper documentation
    drbContent.setTitle(zksample2title);
    drbContent.setTitleStyle(djrst.getTitleStyle());
    drbContent.setWhenNoDataAllSectionNoDetail();
    // drb.setSubtitle("DynamicJasper Sample");
    drbContent.setSubtitleStyle(djrst.getSubtitleStyle());

    drbContent.setHeaderHeight(20);
    drbContent.setDetailHeight(15);
    drbContent.setFooterVariablesHeight(10);
    drbContent.setMargins(20, 20, 30, 15);

    drbContent.setDefaultStyles(djrst.getTitleStyle(), djrst.getSubtitleStyle(), djrst.getHeaderStyleText(), djrst.getColumnStyleText());
    drbContent.setPrintBackgroundOnOddRows(true);

    /**
     * Columns Definitions. A new ColumnBuilder instance for each column.
     */
    // Right name
    AbstractColumn colRightName = ColumnBuilder.getNew().setColumnProperty("rigName", String.class.getName()).build();
    colRightName.setTitle(rigName);
    colRightName.setWidth(60);
    colRightName.setHeaderStyle(djrst.getHeaderStyleText());
    colRightName.setStyle(djrst.getColumnStyleText());
    // Right type
    AbstractColumn colRightType = ColumnBuilder.getNew().setCustomExpression(getMyRightTypExpression()).build();
    colRightType.setTitle(rigType);
    colRightType.setWidth(40);
    colRightType.setHeaderStyle(djrst.getHeaderStyleText());
    colRightType.setStyle(djrst.getColumnStyleText());

    // Add the columns to the report in the whished order
    drbContent.addColumn(colRightName);
    drbContent.addColumn(colRightType);

    // // TEST
    // Style atStyle = new
    // StyleBuilder(true).setFont(Font.COMIC_SANS_SMALL).setTextColor(Color.red).build();
    // /**
    // * Adding many autotexts in the same position (header/footer and
    // * aligment) makes them to be one on top of the other
    // */
    //
    // AutoText created = new AutoText(Labels.getLabel("common.Created") +
    // ": " + ZksampleDateFormat.getDateTimeFormater().format(new Date()),
    // AutoText.POSITION_HEADER, HorizontalBandAlignment.RIGHT);
    // created.setWidth(new Integer(120));
    // created.setStyle(atStyle);
    // drb.addAutoText(created);
    //
    // AutoText autoText = new AutoText(AutoText.AUTOTEXT_PAGE_X_SLASH_Y,
    // AutoText.POSITION_HEADER, HorizontalBandAlignment.RIGHT);
    // autoText.setWidth(new Integer(20));
    // autoText.setStyle(atStyle);
    // drb.addAutoText(autoText);
    //
    // AutoText name1 = new AutoText("The Zksample2 Ltd.",
    // AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    // name1.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    // AutoText name2 = new AutoText("Software Consulting",
    // AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    // name2.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    // AutoText street = new AutoText("256, ZK Direct RIA Street ",
    // AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    // street.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    // AutoText city = new AutoText("ZKoss City", AutoText.POSITION_HEADER,
    // HorizontalBandAlignment.LEFT);
    // city.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    // drb.addAutoText(name1).addAutoText(name2).addAutoText(street).addAutoText(city);
    // // Footer
    // AutoText footerText = new
    // AutoText("Help to prevent the global warming by writing cool software.",
    // AutoText.POSITION_FOOTER, HorizontalBandAlignment.CENTER);
    // footerText.setStyle(djrst.getFooterStyle());
    // drb.addAutoText(footerText);

    // ADD ALL USED FIELDS to the report.
    drbContent.addField("rigType", Integer.class.getName());

    drbContent.setUseFullPageWidth(true); // use full width of the page

    DynamicReport drContent;
    drContent = drbContent.build(); // build the report

    // Get information from database
    List<SecRight> resultList = getSecurityService().getAllRights();

    // Create Datasource and put it in Dynamic Jasper Format
    List data = new ArrayList(resultList.size());

    for (SecRight obj : resultList) {
      Map<String, Object> map = new HashMap<String, Object>();
      map.put("rigName", obj.getRigName());
      map.put("rigType", obj.getRigType());
      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);

    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(drContent, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();

View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

    OrderService sv = (OrderService) SpringUtil.getBean("orderService");
    List<Orderposition> resultList = sv.getOrderpositionsByOrder(getOrder());

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(resultList);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

      data.add(map);
    }

    // Generate the Jasper Print Object
    JRDataSource ds = new JRBeanCollectionDataSource(data);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);

    String outputFormat = "PDF";

    output = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.core.layout.ClassicLayoutManager

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.