Examples of JasperPrint


Examples of net.sf.jasperreports.engine.JasperPrint

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JasperPrint jasperPrint = (JasperPrint)digester.peek(digester.getCount() - 2);

    JRBasePrintRectangle rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
   
    String radius = atts.getValue(JRXmlConstants.ATTRIBUTE_radius);
    if (radius != null && radius.length() > 0)
    {
      rectangle.setRadius(Integer.parseInt(radius));
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

   *
   */
  public Object createObject(Attributes atts)
  {
    JRPrintXmlLoader printXmlLoader = (JRPrintXmlLoader)digester.peek(digester.getCount() - 1);
    JasperPrint jasperPrint = (JasperPrint)digester.peek(digester.getCount() - 2);
    JRBasePrintElement element = (JRBasePrintElement)digester.peek();

    String key = atts.getValue(JRXmlConstants.ATTRIBUTE_key);
    if (key != null)
    {
      element.setKey(key);
    }
   
    ModeEnum mode = ModeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_mode));
    if (mode != null)
    {
      element.setMode(mode);
    }
   
    String x = atts.getValue(JRXmlConstants.ATTRIBUTE_x);
    if (x != null && x.length() > 0)
    {
      element.setX(Integer.parseInt(x));
    }

    String y = atts.getValue(JRXmlConstants.ATTRIBUTE_y);
    if (y != null && y.length() > 0)
    {
      element.setY(Integer.parseInt(y));
    }

    String width = atts.getValue(JRXmlConstants.ATTRIBUTE_width);
    if (width != null && width.length() > 0)
    {
      element.setWidth(Integer.parseInt(width));
    }

    String height = atts.getValue(JRXmlConstants.ATTRIBUTE_height);
    if (height != null && height.length() > 0)
    {
      element.setHeight(Integer.parseInt(height));
    }

    String forecolor = atts.getValue(JRXmlConstants.ATTRIBUTE_forecolor);
    if (forecolor != null && forecolor.length() > 0)
    {
      element.setForecolor(JRColorUtil.getColor(forecolor, null));
    }

    String backcolor = atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor);
    if (backcolor != null && backcolor.length() > 0)
    {
      element.setBackcolor(JRColorUtil.getColor(backcolor, null));
    }

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_style) != null)
    {
      Map stylesMap = jasperPrint.getStylesMap();

      if ( !stylesMap.containsKey(atts.getValue(JRXmlConstants.ATTRIBUTE_style)) )
      {
        printXmlLoader.addError(new JRRuntimeException("Unknown report style : " + atts.getValue(JRXmlConstants.ATTRIBUTE_style)));
      }

      element.setStyle((JRStyle) stylesMap.get(atts.getValue(JRXmlConstants.ATTRIBUTE_style)));
    }

    String origin = atts.getValue(JRXmlConstants.ATTRIBUTE_origin);
    if (origin != null && origin.length() > 0)
    {
      element.setOrigin((JROrigin)jasperPrint.getOriginsList().get(Integer.parseInt(origin)));
    }

    return element;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

public class JRGenericPrintElementFactory extends JRBaseFactory
{

  public Object createObject(Attributes arg0) throws Exception
  {
    JasperPrint jasperPrint = (JasperPrint) digester.peek(digester.getCount() - 2);
    JRBaseGenericPrintElement element = new JRBaseGenericPrintElement(
        jasperPrint.getDefaultStyleProvider());
    return element;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

  /**
   *
   */
  public static JasperPrint load(String sourceFileName) throws JRException
  {
    JasperPrint jasperPrint = null;

    FileInputStream fis = null;

    try
    {
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

  /**
   *
   */
  public static JasperPrint load(InputStream is) throws JRException
  {
    JasperPrint jasperPrint = null;

    JRPrintXmlLoader printXmlLoader = new JRPrintXmlLoader();
    jasperPrint = printXmlLoader.loadXML(is);

    return jasperPrint;
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JasperPrint jasperPrint = new JasperPrint();
   
    jasperPrint.setName(atts.getValue(JRXmlConstants.ATTRIBUTE_name));

    String pageWidth = atts.getValue(JRXmlConstants.ATTRIBUTE_pageWidth);
    if (pageWidth != null && pageWidth.length() > 0)
    {
      jasperPrint.setPageWidth(Integer.parseInt(pageWidth));
    }

    String pageHeight = atts.getValue(JRXmlConstants.ATTRIBUTE_pageHeight);
    if (pageHeight != null && pageHeight.length() > 0)
    {
      jasperPrint.setPageHeight(Integer.parseInt(pageHeight));
    }

    String topMargin = atts.getValue(JRXmlConstants.ATTRIBUTE_topMargin);
    if (topMargin != null && topMargin.length() > 0)
    {
      jasperPrint.setTopMargin(Integer.valueOf(topMargin));
    }

    String leftMargin = atts.getValue(JRXmlConstants.ATTRIBUTE_leftMargin);
    if (leftMargin != null && leftMargin.length() > 0)
    {
      jasperPrint.setLeftMargin(Integer.valueOf(leftMargin));
    }

    String bottomMargin = atts.getValue(JRXmlConstants.ATTRIBUTE_bottomMargin);
    if (bottomMargin != null && bottomMargin.length() > 0)
    {
      jasperPrint.setBottomMargin(Integer.valueOf(bottomMargin));
    }

    String rightMargin = atts.getValue(JRXmlConstants.ATTRIBUTE_rightMargin);
    if (rightMargin != null && rightMargin.length() > 0)
    {
      jasperPrint.setRightMargin(Integer.valueOf(rightMargin));
    }

    OrientationEnum orientation = OrientationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_orientation));
    if (orientation != null)
    {
      jasperPrint.setOrientation(orientation);
    }
   
    String formatFactoryClass = atts.getValue(JRXmlConstants.ATTRIBUTE_formatFactoryClass);
    if (formatFactoryClass != null)
    {
      jasperPrint.setFormatFactoryClass(formatFactoryClass);
    }
   
    String locale = atts.getValue(JRXmlConstants.ATTRIBUTE_locale);
    if (locale != null)
    {
      jasperPrint.setLocaleCode(locale);
    }
   
    String timezone = atts.getValue(JRXmlConstants.ATTRIBUTE_timezone);
    if (timezone != null)
    {
      jasperPrint.setTimeZoneId(timezone);
    }

    return jasperPrint;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

  }


  public static JRPrintImage getImage(List jasperPrintList, JRPrintElementIndex imageIndex)
  {
    JasperPrint report = (JasperPrint)jasperPrintList.get(imageIndex.getReportIndex());
    JRPrintPage page = (JRPrintPage)report.getPages().get(imageIndex.getPageIndex());

    Integer[] elementIndexes = imageIndex.getAddressArray();
    Object element = page.getElements().get(elementIndexes[0].intValue());

    for (int i = 1; i < elementIndexes.length; ++i)
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

    writer.write("  </w:pPrDefault>\n");
    writer.write(" </w:docDefaults>\n");

    for(int reportIndex = 0; reportIndex < jasperPrintList.size(); reportIndex++)
    {
      JasperPrint jasperPrint = (JasperPrint)jasperPrintList.get(reportIndex);
     
      String localeCode = jasperPrint.getLocaleCode();
     
      if (reportIndex == 0)
      {
        JRDesignStyle style = new JRDesignStyle();
        style.setName("EMPTY_CELL_STYLE");
        style.setParentStyle(jasperPrint.getDefaultStyle());
        style.setFontSize(0);
        exportHeader(style);
        paragraphHelper.exportProps(style);
        runHelper.exportProps(style, (localeCode == null ? null : JRDataUtils.getLocale(localeCode)));//FIXMEDOCX reuse exporter
        exportFooter();
      }
     
      JRStyle[] styles = jasperPrint.getStyles();
      if (styles != null)
      {
        for(int i = 0; i < styles.length; i++)
        {
          JRStyle style = styles[i];
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

  }


  public static JRPrintImage getImage(List jasperPrintList, JRPrintElementIndex imageIndex)
  {
    JasperPrint report = (JasperPrint)jasperPrintList.get(imageIndex.getReportIndex());
    JRPrintPage page = (JRPrintPage)report.getPages().get(imageIndex.getPageIndex());

    Integer[] elementIndexes = imageIndex.getAddressArray();
    Object element = page.getElements().get(elementIndexes[0].intValue());

    for (int i = 1; i < elementIndexes.length; ++i)
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperPrint

   */
  public void build() throws IOException
  {
    for(int reportIndex = 0; reportIndex < jasperPrintList.size(); reportIndex++)
    {
      JasperPrint jasperPrint = (JasperPrint)jasperPrintList.get(reportIndex);

      if (reportIndex == 0)
      {
        buildBeforeAutomaticStyles(jasperPrint);
      }
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.