Package ar.com.fdvs.dj.domain.builders

Examples of ar.com.fdvs.dj.domain.builders.DynamicReportBuilder


    // Localized column headers
    String rigName = Labels.getLabel("listheader_SecRightList_rigName.label");
    String rigType = Labels.getLabel("listheader_SecRightList_rigType.label");

    DynamicReportBuilder drbContent = new DynamicReportBuilder();

    // 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
View Full Code Here


    // Rows content Style (right-align)
    Style columnDetailStyleNumbers = new Style();
    columnDetailStyleNumbers.setFont(Font.VERDANA_SMALL);
    columnDetailStyleNumbers.setHorizontalAlign(HorizontalAlign.RIGHT);

    DynamicReportBuilder drb = new DynamicReportBuilder();
    DynamicReport dr;

    // Sets the Report Columns, header, Title, Groups, Etc Formats
    // DynamicJasper documentation
    drb.setTitle(zksample2title);
    // drb.setSubtitle("DynamicJasper Sample");
    drb.setSubtitleStyle(subtitleStyle);

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

    drb.setDefaultStyles(titleStyle, subtitleStyle, columnHeaderStyleText, columnDetailStyleText);
    drb.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(columnHeaderStyleText);
    colRightName.setStyle(columnDetailStyleText);
    // Right type
    AbstractColumn colRightType = ColumnBuilder.getNew().setCustomExpression(getMyRightTypExpression()).build();
    colRightType.setTitle(rigType);
    colRightType.setWidth(40);
    colRightType.setHeaderStyle(columnHeaderStyleText);
    colRightType.setStyle(columnDetailStyleText);

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

    // TEST
    Style atStyle = new StyleBuilder(true).setFont(Font.VERDANA_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(footerStyle);
    drb.addAutoText(footerText);

    /**
     * ADD ALL USED BUT NOT DIRECT PRINTED FIELDS to the report. We replace
     * the field 'rigType' with a customExpression
     */
    drb.addField("rigType", Integer.class.getName());

    drb.setUseFullPageWidth(true); // use full width of the page
    dr = drb.build(); // build the report

    // Get information from database
    SecurityService sv = (SecurityService) SpringUtil.getBean("securityService");
    List<SecRight> resultList = sv.getAllRights();

View Full Code Here

    // Rows content
    Style columnDetailStyleNumbers = new Style();
    columnDetailStyleNumbers.setFont(Font.VERDANA_SMALL);
    columnDetailStyleNumbers.setHorizontalAlign(HorizontalAlign.RIGHT);

    DynamicReportBuilder drb = new DynamicReportBuilder();
    DynamicReport dr;

    // Sets the Report Columns, header, Title, Groups, Etc Formats
    // DynamicJasper documentation
    drb.setTitle(this.zksample2title);
    drb.setSubtitle("List of Users: " + ZksampleDateFormat.getDateFormater().format(new Date()));
    drb.setSubtitleStyle(subtitleStyle);
    drb.setDetailHeight(10);
    drb.setMargins(20, 20, 30, 15);
    drb.setDefaultStyles(titleStyle, subtitleStyle, columnHeaderStyleText, columnDetailStyleText);
    drb.setPrintBackgroundOnOddRows(true);

    /**
     * Columns Definitions. A new ColumnBuilder instance for each column.
     */
    // Login name
    AbstractColumn colLoginName = ColumnBuilder.getNew().setColumnProperty("usrLoginname", String.class.getName()).build();
    colLoginName.setTitle(usrLoginname);
    colLoginName.setWidth(30);
    colLoginName.setHeaderStyle(columnHeaderStyleText);
    colLoginName.setStyle(columnDetailStyleText);
    // Last name
    AbstractColumn colLastName = ColumnBuilder.getNew().setColumnProperty("usrLastname", String.class.getName()).build();
    colLastName.setTitle(usrLastname);
    colLastName.setWidth(50);
    colLastName.setHeaderStyle(columnHeaderStyleText);
    colLastName.setStyle(columnDetailStyleText);
    // First name
    AbstractColumn colFirstName = ColumnBuilder.getNew().setColumnProperty("usrFirstname", String.class.getName()).build();
    colFirstName.setTitle(usrFirstname);
    colFirstName.setWidth(50);
    colFirstName.setHeaderStyle(columnHeaderStyleText);
    colFirstName.setStyle(columnDetailStyleText);
    // Email address
    AbstractColumn colEmail = ColumnBuilder.getNew().setColumnProperty("usrEmail", String.class.getName()).build();
    colEmail.setTitle(usrEmail);
    colEmail.setWidth(50);
    colEmail.setHeaderStyle(columnHeaderStyleText);
    colEmail.setStyle(columnDetailStyleText);
    // Account enabled
    AbstractColumn colEnabled = ColumnBuilder.getNew().setCustomExpression(getMyBooleanExpression()).build();
    colEnabled.setTitle(usrEnabled);
    colEnabled.setWidth(10);
    colEnabled.setHeaderStyle(columnHeaderStyleText);
    colEnabled.setStyle(columnDetailStyleText);

    // Add the columns to the report in the whished order
    drb.addColumn(colLoginName);
    drb.addColumn(colLastName);
    drb.addColumn(colFirstName);
    drb.addColumn(colEmail);
    drb.addColumn(colEnabled);

    // Add the usrEnabled field to the report.
    drb.addField("usrEnabled", Boolean.class.getName());

    drb.setUseFullPageWidth(true); // use full width of the page
    dr = drb.build(); // build the report

    // Get information from database
    UserService sv = (UserService) SpringUtil.getBean("userService");
    List<SecUser> resultList = sv.getAllUsers();

View Full Code Here

    Style footerStyleTotalSumValue = new Style();
    footerStyleTotalSumValue.setFont(Font.VERDANA_MEDIUM_BOLD);
    footerStyleTotalSumValue.setHorizontalAlign(HorizontalAlign.RIGHT);
    footerStyleTotalSumValue.setBorderTop(Border.PEN_1_POINT);

    DynamicReportBuilder drb = new DynamicReportBuilder();
    DynamicReport dr;

    // Sets the Report Columns, header, Title, Groups, Etc Formats
    // DynamicJasper documentation
    drb.setTitle(this.zksample2title);
    // drb.setSubtitle("DynamicJasper Sample");
    drb.setSubtitleStyle(subtitleStyle);

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

    drb.setDefaultStyles(titleStyle, subtitleStyle, columnHeaderStyleText, columnDetailStyleText);
    drb.setPrintBackgroundOnOddRows(true);

    /**
     * Adding many autotexts in the same position (header/footer and
     * aligment) makes them to be one on top of the other
     */
    Style atStyle = new StyleBuilder(true).setFont(Font.COMIC_SANS_SMALL).setTextColor(Color.red).build();

    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 atCustomerHeader = new AutoText(Labels.getLabel("orderDialogWindow.title") + " :  " + getOrder().getAufBezeichnung(), AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    atCustomerHeader.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    atCustomerHeader.setStyle(subtitleStyleUL);
    AutoText name1 = new AutoText(getCustomer().getKunName1(), AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    name1.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    AutoText name2 = new AutoText(getCustomer().getKunName2(), AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    name2.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    AutoText city = new AutoText(getCustomer().getKunOrt(), AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    city.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    AutoText emptyLine = new AutoText("", AutoText.POSITION_HEADER, HorizontalBandAlignment.LEFT);
    emptyLine.setPrintWhenExpression(ExpressionHelper.printInFirstPage());
    drb.addAutoText(atCustomerHeader).addAutoText(emptyLine).addAutoText(name1).addAutoText(name2).addAutoText(city).addAutoText(emptyLine);

    // Footer
    AutoText footerText = new AutoText("Help to prevent the global warming by writing cool software.", AutoText.POSITION_FOOTER, HorizontalBandAlignment.CENTER);
    footerText.setStyle(footerStyle);
    drb.addAutoText(footerText);

    /**
     * Columns Definitions. A new ColumnBuilder instance for each column.
     */
    // Quantity
    AbstractColumn colQuantity = ColumnBuilder.getNew().setColumnProperty("aupMenge", BigDecimal.class.getName()).build();
    colQuantity.setTitle(quantity);
    colQuantity.setWidth(40);
    colQuantity.setPattern("#,##0.00");
    colQuantity.setHeaderStyle(columnHeaderStyleNumber);
    colQuantity.setStyle(columnDetailStyleNumbers);

    // Article Text
    AbstractColumn colArticleText = ColumnBuilder.getNew().setColumnProperty("article.artKurzbezeichnung", String.class.getName()).build();
    colArticleText.setTitle(articleText);
    colArticleText.setWidth(100);
    colArticleText.setHeaderStyle(columnHeaderStyleText);
    colArticleText.setStyle(columnDetailStyleText);

    // Single Price
    AbstractColumn colSinglePrice = ColumnBuilder.getNew().setColumnProperty("aupEinzelwert", BigDecimal.class.getName()).build();
    colSinglePrice.setTitle(singlePrice);
    colSinglePrice.setWidth(40);
    colSinglePrice.setPattern("#,##0.00");
    colSinglePrice.setHeaderStyle(columnHeaderStyleNumber);
    colSinglePrice.setStyle(columnDetailStyleNumbers);

    // Line Sum
    AbstractColumn colLineSum = ColumnBuilder.getNew().setColumnProperty("aupGesamtwert", BigDecimal.class.getName()).build();
    colLineSum.setTitle(lineSum);
    colLineSum.setWidth(40);
    // #,##0. €00
    colLineSum.setPattern("#,##0.00");
    colLineSum.setHeaderStyle(columnHeaderStyleNumber);
    colLineSum.setStyle(columnDetailStyleNumbers);

    // Add the columns to the report in the whished order
    drb.addColumn(colQuantity);
    drb.addColumn(colArticleText);
    drb.addColumn(colSinglePrice);
    drb.addColumn(colLineSum);

    /**
     * Add a global total sum for the lineSum field.
     */
    drb.addGlobalFooterVariable(colLineSum, DJCalculation.SUM, footerStyleTotalSumValue);
    drb.setGlobalFooterVariableHeight(new Integer(20));
    drb.setGrandTotalLegend(Labels.getLabel("common.Sum"));

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

    drb.setUseFullPageWidth(true); // use full width of the page
    dr = drb.build(); // build the report

    // Get information from database
    OrderService sv = (OrderService) SpringUtil.getBean("orderService");
    List<Orderposition> resultList = sv.getOrderpositionsByOrder(getOrder());

View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.builders.DynamicReportBuilder

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.