Package ar.com.fdvs.dj.domain

Examples of ar.com.fdvs.dj.domain.Style


    public String export(final List<ExportableField> exportableFields, final List<T> records) throws Exception {
        // Dynamic report
        final FastReportBuilder drb = new FastReportBuilder();

        // Style header
        final Style headerStyle = new Style();
        headerStyle.setVerticalAlign(VerticalAlign.MIDDLE);
        headerStyle.setHorizontalAlign(HorizontalAlign.CENTER);
        headerStyle.setTransparent(false);
        headerStyle.setBackgroundColor(Color.LIGHT_GRAY);
        headerStyle.setBorder(Border.THIN);

        // Style column
        final Style columnStyle = new Style();
        columnStyle.setVerticalAlign(VerticalAlign.MIDDLE);
        columnStyle.setHorizontalAlign(HorizontalAlign.CENTER);
        columnStyle.setBorder(Border.THIN);

        // Add column
        for (final ExportableField exportableField : exportableFields) {
            drb.addColumn(exportableField.getCaption(), exportableField.getKey(), String.class, 10, columnStyle, headerStyle);
        }
View Full Code Here


        textField.setEvaluationGroup(jgroup);
        //Assign the style to the element.
        //First we look for the specific element style, then the default style for the group variables
        //and finally the column style.
        Style defStyle = DJConstants.HEADER.equals(type)?columnsGroup.getDefaulHeaderStyle():columnsGroup.getDefaulFooterStyle();

        if (var.getStyle() != null)
          applyStyleToElement(var.getStyle(), textField);
        else if (defStyle != null)
          applyStyleToElement(defStyle, textField);
View Full Code Here

   * Creates the graphic element to be shown when the datasource is empty
   */
  protected void setWhenNoDataBand() {
    log.debug("setting up WHEN NO DATA band");
    String whenNoDataText = getReport().getWhenNoDataText();
    Style style = getReport().getWhenNoDataStyle();
    if (whenNoDataText == null || "".equals(whenNoDataText))
      return;
    JRDesignBand band = new JRDesignBand();
    getDesign().setNoData(band);
   
View Full Code Here

   */
  protected void ensureDJStyles()  {

    //first of all, register all parent styles if any
    for (Iterator iterator = getReport().getStyles().values().iterator(); iterator.hasNext();) {
      Style style = (Style) iterator.next();
      addStyleToDesign(style);
    }

    Style defaultDetailStyle = getReport().getOptions().getDefaultDetailStyle();

      Style defaultHeaderStyle = getReport().getOptions().getDefaultHeaderStyle();
  //    Style defaultFooterStyle = getReport().getOptions().getDefaultFooterStyle();
      for (Iterator iter = report.getColumns().iterator(); iter.hasNext();) {
        AbstractColumn column = (AbstractColumn) iter.next();
        if (column.getStyle() == null)
          column.setStyle(defaultDetailStyle);
View Full Code Here

    rectangle.setPrintWhenExpression(expression);
    DynamicReportOptions options = getReport().getOptions();
    rectangle.setHeight(options.getDetailHeight().intValue());
    rectangle.setWidth(options.getColumnWidth());
    rectangle.setStretchType(JRDesignRectangle.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT);
    Style oddRowBackgroundStyle = options.getOddRowBackgroundStyle();

    addStyleToDesign(oddRowBackgroundStyle);//register this style in the jasperDesign

    JRDesignStyle style = oddRowBackgroundStyle.transform();
    style.setForecolor(oddRowBackgroundStyle.getBackgroundColor());

    applyStyleToElement(oddRowBackgroundStyle, rectangle);
//    rectangle.setStyle(style);
    rectangle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
    rectangle.setForecolor(oddRowBackgroundStyle.getBorderColor());
    rectangle.setPen(oddRowBackgroundStyle.getBorder().getValue());
    rectangle.setMode(JRDesignElement.MODE_OPAQUE);
    detail.addElement(rectangle);
  }
View Full Code Here

      textField.setWidth(col.getWidth().intValue());

      textField.setPrintWhenDetailOverflows(true);
      textField.setBlankWhenNull(true);

      Style headerStyle = col.getHeaderStyle();
      if (headerStyle == null)
        headerStyle = report.getOptions().getDefaultHeaderStyle();

      applyStyleToElement(headerStyle, textField);
View Full Code Here

    textField.setPrintRepeatedValues(col.getPrintRepeatedValues().booleanValue());

        textField.setPrintWhenDetailOverflows(true);

        Style columnStyle = col.getStyle();
        if (columnStyle == null)
          columnStyle = report.getOptions().getDefaultDetailStyle();

    applyStyleToElement(columnStyle, textField);
View Full Code Here

//  protected Map headerGroupVariables = new TreeMap();
//  protected Map footerGroupVariables = new TreeMap();

  public FastReportBuilder(){
    currencyStyle = new Style("currencyStyle");
    currencyStyle.setHorizontalAlign(HorizontalAlign.RIGHT);

    numberStyle = new Style("numberStyle");
    numberStyle.setHorizontalAlign(HorizontalAlign.RIGHT);

    Style defaultHeaderStyle = options.getDefaultHeaderStyle();
    defaultHeaderStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
    defaultHeaderStyle.setHorizontalAlign(HorizontalAlign.CENTER);
    defaultHeaderStyle.setBorderBottom(Border.THIN);
    defaultHeaderStyle.setVerticalAlign(VerticalAlign.MIDDLE);
    defaultHeaderStyle.setBackgroundColor(Color.LIGHT_GRAY);
    defaultHeaderStyle.setTransparency(Transparency.OPAQUE);

    Style titleStyle2 = report.getTitleStyle();
    titleStyle2.setFont(Font.ARIAL_BIG_BOLD);
    titleStyle2.setHorizontalAlign(HorizontalAlign.CENTER);
    titleStyle2.setVerticalAlign(VerticalAlign.TOP);
  }
View Full Code Here

        textField.setEvaluationGroup(jgroup);
        //Assign the style to the element.
        //First we look for the specific element style, then the default style for the group variables
        //and finally the column style.
        Style defStyle = DJConstants.HEADER.equals(type)?columnsGroup.getDefaulHeaderStyle():columnsGroup.getDefaulFooterStyle();

        if (var.getStyle() != null)
          applyStyleToElement(var.getStyle(), textField);
        else if (defStyle != null)
          applyStyleToElement(defStyle, textField);
View Full Code Here

   * Creates the graphic element to be shown when the datasource is empty
   */
  protected void setWhenNoDataBand() {
    log.debug("setting up WHEN NO DATA band");
    String whenNoDataText = getReport().getWhenNoDataText();
    Style style = getReport().getWhenNoDataStyle();
    if (whenNoDataText == null || "".equals(whenNoDataText))
      return;
    JRDesignBand band = new JRDesignBand();
    getDesign().setNoData(band);
   
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.Style

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.