Package net.sf.jasperreports.engine.export.zip

Examples of net.sf.jasperreports.engine.export.zip.FileBufferedZipEntry


        String extension = mimeType.substring(mimeType.lastIndexOf('/') + 1);
       
        String imageName = getImageName(imageIndex);
       
        docxZip.addEntry(//FIXMEDOCX optimize with a different implementation of entry
          new FileBufferedZipEntry(
            "word/media/" + imageName + "." + extension,
            renderer.getImageData()
            )
          );
       
View Full Code Here


          String extension = mimeType.substring(mimeType.lastIndexOf('/') + 1);
         
          String imageName = IMAGE_NAME_PREFIX + imageIndex.toString() + "." + extension;
         
          xlsxZip.addEntry(//FIXMEDOCX optimize with a different implementation of entry
            new FileBufferedZipEntry(
              "xl/media/" + imageName,
              renderer.getImageData()
              )
            );
         
View Full Code Here

  /**
   *
   */
  public ExportZipEntry createEntry(String name)
  {
    return new FileBufferedZipEntry(name);
  }
View Full Code Here

   */
  protected void exportReportToOasisZip(OutputStream os) throws JRException, IOException
  {
    OasisZip oasisZip = new FileBufferedOasisZip(((JROpenDocumentExporterNature)nature).getOpenDocumentNature());

    ExportZipEntry tempBodyEntry = new FileBufferedZipEntry(null);
    ExportZipEntry tempStyleEntry = new FileBufferedZipEntry(null);

    tempBodyWriter = tempBodyEntry.getWriter();
    tempStyleWriter = tempStyleEntry.getWriter();

    styleCache = new StyleCache(tempStyleWriter, fontMap, getExporterKey());

    Writer stylesWriter = oasisZip.getStylesEntry().getWriter();

    StyleBuilder styleBuilder = new StyleBuilder(jasperPrintList, stylesWriter);
    styleBuilder.build();

    stylesWriter.close();

    for(reportIndex = 0; reportIndex < jasperPrintList.size(); reportIndex++)
    {
      setJasperPrint((JasperPrint)jasperPrintList.get(reportIndex));

      List pages = jasperPrint.getPages();
      if (pages != null && pages.size() > 0)
      {
        if (isModeBatch)
        {
          startPageIndex = 0;
          endPageIndex = pages.size() - 1;
        }

        JRPrintPage page = null;
        for(pageIndex = startPageIndex; pageIndex <= endPageIndex; pageIndex++)
        {
          if (Thread.interrupted())
          {
            throw new JRException("Current thread interrupted.");
          }

          page = (JRPrintPage)pages.get(pageIndex);

          exportPage(page);
        }
      }
    }


    tempBodyWriter.flush();
    tempStyleWriter.flush();


    tempBodyWriter.close();
    tempStyleWriter.close();


    /*   */
    ContentBuilder contentBuilder =
      new ContentBuilder(
        oasisZip.getContentEntry(),
        tempStyleEntry,
        tempBodyEntry,
        styleCache.getFontFaces(),
        ((JROpenDocumentExporterNature)nature).getOpenDocumentNature()
        );
    contentBuilder.build();

    tempStyleEntry.dispose();
    tempBodyEntry.dispose();

    if ((imagesToProcess != null && imagesToProcess.size() > 0))
    {
      for(Iterator it = imagesToProcess.iterator(); it.hasNext();)
      {
        JRPrintElementIndex imageIndex = (JRPrintElementIndex)it.next();

        JRPrintImage image = getImage(jasperPrintList, imageIndex);
        JRRenderable renderer = image.getRenderer();
        if (renderer.getType() == JRRenderable.TYPE_SVG)
        {
          renderer =
            new JRWrappingSvgRenderer(
              renderer,
              new Dimension(image.getWidth(), image.getHeight()),
              ModeEnum.OPAQUE == image.getModeValue() ? image.getBackcolor() : null
              );
        }

        oasisZip.addEntry(//FIXMEODT optimize with a different implementation of entry
          new FileBufferedZipEntry(
            "Pictures/" + getImageName(imageIndex),
            renderer.getImageData()
            )
          );
      }
View Full Code Here

        String extension = mimeType.substring(mimeType.lastIndexOf('/') + 1);
       
        String imageName = IMAGE_NAME_PREFIX + imageIndex.toString() + "." + extension;
       
        pptxZip.addEntry(//FIXMEPPTX optimize with a different implementation of entry
          new FileBufferedZipEntry(
            "ppt/media/" + imageName,
            renderer.getImageData()
            )
          );
       
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.zip.FileBufferedZipEntry

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.