Package org.eclipse.birt.report.engine.api

Examples of org.eclipse.birt.report.engine.api.HTMLRenderOption


            throw new GeneralException("Unknown content type : " + contentType);
        }

        if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_HTML)) {
            // set html render options
            HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
            htmlOptions.setImageDirectory(birtImageDirectory);
            htmlOptions.setBaseImageURL(birtImageDirectory);
            options.setImageHandler(imageHandler);
        } else if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_PDF)) {
            // set pdf render options
            PDFRenderOption pdfOptions = new PDFRenderOption(options);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE );
View Full Code Here


        // set output options
        RenderOption options = new RenderOption();
        if ("text/html".equalsIgnoreCase(contentType)) { // HTML
            options.setOutputFormat(RenderOption.OUTPUT_FORMAT_HTML);
            HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
            htmlOptions.setImageDirectory(birtImageDirectory);
            htmlOptions.setBaseImageURL(birtImageDirectory);
            options.setImageHandler(imageHandler);
        } else if ("application/postscript".equalsIgnoreCase(contentType)) { // Post Script
            options.setOutputFormat("postscript");
        } else if ("application/pdf".equalsIgnoreCase(contentType)) { // PDF
            options.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF);
View Full Code Here

  {       
    log.info("Starting BIRT Engine and OSGI Platform using: " + context.getClass().getName());   
       
    HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
   
    HTMLRenderOption emitterConfig = new HTMLRenderOption();
    emitterConfig.setActionHandler(new HTMLActionHandler());   
    emitterConfig.setImageHandler(imageHandler);

    EngineConfig config = new EngineConfig();
    config.setEngineHome("");
    config.setPlatformContext(context);               
    config.setLogConfig(null, Level.ALL);     
View Full Code Here

    IReportEngine engine = BirtProvider
        .getBirtEngine(directoryProvider.getReportDirectory() + "platform");   

    // Set options for task
    HTMLRenderOption renderOption = new HTMLRenderOption();
    renderOption.setOutputStream(out);     
    renderOption.setImageDirectory(directoryProvider.getTempDirectory());
    renderOption.setBaseImageURL("report-images");   
           
    try
    {
      String designFile = directoryProvider.getReportDirectory() + report.getFile();
     
      log.info("Loading BIRT report design: " + report.getFile());
     
      IReportRunnable design = engine.openReportDesign(designFile);     
           
      handleDataSourceOverrides(design);       
     
      if (input.getExportType() == ExportType.PDF)
      {     
        output.setContentType(ReportEngineOutput.CONTENT_TYPE_PDF);
        renderOption.setOutputFormat(IRenderOption.OUTPUT_FORMAT_PDF);       
      }
      else if (input.getExportType() == ExportType.HTML || input.getExportType() == ExportType.HTML_EMBEDDED)
      {     
        output.setContentType(ReportEngineOutput.CONTENT_TYPE_HTML);
        renderOption.setOutputFormat(IRenderOption.OUTPUT_FORMAT_HTML)
       
        if (input.getExportType() == ExportType.HTML_EMBEDDED)
        {
          renderOption.setEmbeddable(true);
        }
      }
      else if (input.getExportType() == ExportType.XLS)
      {     
        output.setContentType(ReportEngineOutput.CONTENT_TYPE_XLS);
        renderOption.setOutputFormat("xls");       
      }
      else
      {
        log.error("Export type not yet implemented: " + input.getExportType());
      }
View Full Code Here

            throw new GeneralException("Unknown content type : " + contentType);
        }

        if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_HTML)) {
            // set html render options
            HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
            htmlOptions.setImageDirectory(birtImageDirectory);
            htmlOptions.setBaseImageURL(birtImageDirectory);
            options.setImageHandler(imageHandler);
        } else if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_PDF)) {
            // set pdf render options
            PDFRenderOption pdfOptions = new PDFRenderOption(options);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE );
View Full Code Here

                    .createRunAndRenderTask(report);
            task.getAppContext().put(
                    "org.eclipse.birt.report.data.oda.xml.inputStream",
                    xmlStream);

            HTMLRenderOption options = new HTMLRenderOption();
            options.setOutputStream((OutputStream) context.get("outputStream"));
            options.setOutputFormat("html");
            options.setEmbeddable(false);

            task.setRenderOption(options);
            task.run();
            task.close();
View Full Code Here

                    .createRunAndRenderTask(report);
            task.getAppContext().put(
                    "org.eclipse.birt.report.data.oda.xml.inputStream",
                    xmlStream);

            HTMLRenderOption options = new HTMLRenderOption();
            options.setOutputStream((OutputStream) context.get("outputStream"));
            options.setOutputFormat("html");
            options.setEmbeddable(false);

            task.setRenderOption(options);
            task.run();
            task.close();
View Full Code Here

                    .createRunAndRenderTask(report);
            task.getAppContext().put(
                    "org.eclipse.birt.report.data.oda.xml.inputStream",
                    xmlStream);

            HTMLRenderOption options = new HTMLRenderOption();
            options.setOutputStream((OutputStream) context.get("outputStream"));
            options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
            options.setEmbeddable(false);

            task.setRenderOption(options);
            task.run();
            task.close();
View Full Code Here

    String imageDirectory = tmpDir.endsWith(File.separator) ? tmpDir + "birt" : tmpDir + File.separator + "birt";
    String contextPath = servletRequest.getContextPath();
    String imageBaseUrl = "/BirtImageServlet?imageID=";

    // Register new image handler
    HTMLRenderOption renderOption = new HTMLRenderOption();
    renderOption.setActionHandler(new HTMLActionHandler());
    HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
    renderOption.setImageHandler(imageHandler);
    renderOption.setImageDirectory(imageDirectory);
    renderOption.setBaseImageURL(contextPath + imageBaseUrl);
    renderOption.setEmbeddable(false);
    this.birtReportEngine.getConfig().getEmitterConfigs().put("html", renderOption);
    logger.debug("OUT");
    return renderOption;

  }
View Full Code Here

            task.getAppContext().put("BIRT_VIEWER_HTTPSERVLET_REQUEST", req );
            task.setParameterValue("title", "用户图形报表");
            task.setParameterValue("tip", "测试用户报表");
           
            HTMLRenderOption options = new HTMLRenderOption();
            options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            options.setOutputStream(out);
            options.setImageHandler(new HTMLServerImageHandler());
            options.setBaseImageURL(SystemListener.getContextPath() + "/platform/reports/images");
            options.setImageDirectory(FileUtils.getAbsolutePath("/platform/reports/images"));
            task.setRenderOption(options);

            task.run();
            task.close();
            total=(float)Runtime.getRuntime().totalMemory()/1000000 - total;
View Full Code Here

TOP

Related Classes of org.eclipse.birt.report.engine.api.HTMLRenderOption

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.