Package net.sf.jasperreports.engine.export

Examples of net.sf.jasperreports.engine.export.JRPdfExporter$LocalFontMapper


      logger.debug("filling report");
      JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, datasource);
      JRExporter exporter=null;
      if(outputType.equalsIgnoreCase("PDF")){
        exporter = (JRExporter)Class.forName("net.sf.jasperreports.engine.export.JRPdfExporter").newInstance();
        if(exporter == null) exporter = new JRPdfExporter();  
      }
      else{
        exporter = (JRExporter)Class.forName("net.sf.jasperreports.engine.export.JRRtfExporter").newInstance();
        if(exporter == null) exporter = new JRRtfExporter();          
      }
View Full Code Here


    } else if (outputType.equalsIgnoreCase("text/plain")) {
         exporter = new JRTextExporter();
    } else if (outputType.equalsIgnoreCase("text/csv")) {
         exporter = new JRCsvExporter();  
    } else if (outputType.equalsIgnoreCase("application/pdf"))  {     
         exporter = new JRPdfExporter();  
    } else if (outputType.equalsIgnoreCase("application/rtf"))  {     
         exporter = new JRRtfExporter();    
    } else if (outputType.equalsIgnoreCase("application/vnd.ms-excel")) {
         exporter = new JExcelApiExporter();
    } else {
         exporter = new JRPdfExporter();
    }
    return exporter;
  }
View Full Code Here

        exporter.setParameter(JRTextExporterParameter.PAGE_HEIGHT,new Integer(100));
        exporter.setParameter(JRTextExporterParameter.PAGE_WIDTH,new Integer(100));
      } else if (outputType.equalsIgnoreCase("pdf"))  {     
        if(mimeType == null) mimeType = "application/pdf";
        servletResponse.setContentType(mimeType);
        if(exporter == null) exporter = new JRPdfExporter();  
      } else if (outputType.equalsIgnoreCase("JPG"))  { 
        byte[] bytes = getImageBytes(report, jasperPrint);
        if(mimeType == null) mimeType = "application/jpeg";
        out.write(bytes);
        return;
      } else if (outputType.equalsIgnoreCase("JPGBASE64"))  { 
        byte[] bytes = getImagesBase64Bytes(report, jasperPrint);
        if(mimeType == null) mimeType = "text/plain";
        out.write(bytes);
        return;
      } else {
        if(mimeType != null && exporter != null) servletResponse.setContentType(mimeType);
        else {
          logger.warn("Impossible to load exporter for type " + outputType);
          logger.warn("Pdf exporter will be used");
          servletResponse.setContentType("application/pdf");
          exporter = new JRPdfExporter();
        }
      }

      logger.debug("MIME type of response is [" + servletResponse.getContentType()+ "]");
      logger.debug("Exporter class used is  [" + exporter.getClass().getName()+ "]");
View Full Code Here

                JRExporter exporter = null;
               
                if (type.equals(Constants.REPORT_TYPE_PDF))
                {
                    res.setContentType("application/pdf");
                    exporter = new JRPdfExporter();
                }
                else if (type.equals("rtf"))
                {
                    res.setContentType("application/rtf");
                    exporter = new JRRtfExporter();
View Full Code Here

    JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, parametros, conexao );

    // Exporta em PDF, escrevendo os dados no output stream do response.

    JRExporter exporter = new JRPdfExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint);

    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,out);

    // gera o relatório

    exporter.exportReport();

    // retorna o OutputStream

    return out;
    }
View Full Code Here

            JRExporter exporter;

            if (format.equals(FORMAT_PDF)) {
                response.setContentType("application/pdf");
                exporter = new JRPdfExporter();
            } else if (format.equals(FORMAT_CSV)) {
                response.setContentType("text/plain");
                exporter = new JRCsvExporter();
            } else if (format.equals(FORMAT_HTML)) {
                response.setContentType("text/html");
View Full Code Here

            JRExporter exporter;

            if (format.equals(FORMAT_PDF)) {
                response.setContentType("application/pdf");
                exporter = new JRPdfExporter();
            } else if (format.equals(FORMAT_CSV)) {
                response.setContentType("text/plain");
                exporter = new JRCsvExporter();
            } else if (format.equals(FORMAT_HTML)) {
                response.setContentType("text/html");
View Full Code Here

    }

    @Override
    protected void doExport(final OutputStream outputStream, final Print print) throws JRException {

        JRPdfExporter exporter = new JRPdfExporter(print.context);

        exporter.setParameter(JRExporterParameter.JASPER_PRINT, print.print);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);
        exporter.setParameter(JRPdfExporterParameter.PDF_VERSION, JRPdfExporterParameter.PDF_VERSION_1_7);
        final PDFConfig pdfConfig = print.values.getObject(Values.PDF_CONFIG, PDFConfig.class);
        exporter.setParameter(JRPdfExporterParameter.IS_COMPRESSED, pdfConfig.isCompressed());
        exporter.setParameter(JRPdfExporterParameter.METADATA_AUTHOR, pdfConfig.getAuthor());
        exporter.setParameter(JRPdfExporterParameter.METADATA_CREATOR, pdfConfig.getCreator());
        exporter.setParameter(JRPdfExporterParameter.METADATA_SUBJECT, pdfConfig.getSubject());
        exporter.setParameter(JRPdfExporterParameter.METADATA_TITLE, pdfConfig.getTitle());
        exporter.setParameter(JRPdfExporterParameter.METADATA_KEYWORDS, pdfConfig.getKeywordsAsString());

        exporter.exportReport();
    }
View Full Code Here

            JRExporter exporter;

            if (format.equals(FORMAT_PDF)) {
                response.setContentType("application/pdf");
                exporter = new JRPdfExporter();
            } else if (format.equals(FORMAT_CSV)) {
                response.setContentType("text/csv");
                exporter = new JRCsvExporter();
            } else if (format.equals(FORMAT_HTML)) {
                response.setContentType("text/html");
View Full Code Here

            JRExporter exporter;

            if (format.equals(FORMAT_PDF)) {
                response.setContentType("application/pdf");
                exporter = new JRPdfExporter();
            } else if (format.equals(FORMAT_CSV)) {
                response.setContentType("text/csv");
                exporter = new JRCsvExporter();
            } else if (format.equals(FORMAT_HTML)) {
                response.setContentType("text/html");
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.JRPdfExporter$LocalFontMapper

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.