Interface ReportGenerator

All Known Implementing Classes:
Engine, EngineBundle

public interface ReportGenerator
Helper interface to use the same code for Engine and EngineBundle
Since:
14.1
  • Method Details

    • setDocumentOutput

      void setDocumentOutput(DocumentOutput documentOutput)
      Set the output location for the rendered data. By default the memory (heap) is used. It is also possible to store the data into the report cache or stream it directly to an OutputStream. This must be set before call of execute().
      Parameters:
      documentOutput - The location for the data. This can be DocumentOutputStream or CachedOutput.
      Since:
      16.2
    • setUserProperties

      void setUserProperties(Properties props) throws ReportException
      Parameters:
      props - The data to be set in a Properties object.
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
    • setClientLocale

      void setClientLocale(@Nonnull Locale locale) throws ReportException
      Parameters:
      locale - The locale to be used by the client
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
    • stopAfterPage

      void stopAfterPage(int maxPageNo)
      See Engine.stopAfterPage(int) for details.
      Parameters:
      maxPageNo - The last page that should be rendered. 0 means "unlimited".
      Since:
      14.1
    • setPrompt

      void setPrompt(String name, String prompt) throws ReportException
      Parameters:
      name - the name of the parameter field
      prompt - value for parameter field as String
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
    • getPromptField

      PromptField getPromptField(String name) throws ReportException
      Parameters:
      name - name of the prompt to fetch
      Returns:
      PromptField by the given name in this Report, or null if none exists
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
    • setPrompt

      void setPrompt(String prompt, int i) throws ReportException
      Parameters:
      prompt - value for parameter field i
      i - index in the parameter list
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
    • execute

      void execute() throws ReportException
      See Engine.execute() for details.
      Throws:
      ReportException - if Engine is not initialized or finished.
      Since:
      14.1
      See Also:
    • getPageCount

      int getPageCount() throws ReportException
      See Engine.getPageCount() for details.
      Returns:
      number of pages or chunks
      Throws:
      ReportException - If rendering the report encounters a problem
      Since:
      14.1
    • getPageData

      byte[] getPageData(int page) throws ReportException
      See Engine.getPageData(int) for details.
      Parameters:
      page - The number of the page. The first page is 1, the second is 2, ... . If the page number is bigger than the page count then null will be returned.
      Returns:
      the binary data for the Java Viewer or the bytes of the exported file (page).
      Throws:
      IllegalArgumentException - if the page number is zero or negative.
      ReportException - If rendering the page encounters a problem
      Since:
      14.1
    • getStatistics

      @Nonnull EngineStatistics getStatistics()
      See Engine.getStatistics() for details.
      Returns:
      the statistic
      Since:
      14.1
    • stop

      void stop(String message)
      See Engine.stop(String) for details.
      Parameters:
      message - a message for the debug log.
      Since:
      14.1