Interface ReportImportExport

All Known Implementing Classes:
ReportImportExportImpl

public interface ReportImportExport
Provides methods to import and export reports
  • Method Details

    • exportReports

      byte[] exportReports(Collection<Report> reports)
      Exports all reports and their templates into one zip archive. Each report is exported into a separate zip archive with 2 files (report.xml and a template file (for example MyReport.doc)). For example: return byte[] (bytes of zip arhive) -- MegaReport.zip ---- report.xml ---- Mega report.xls -- Other report.zip ---- report.xml ---- other report.odt
      Parameters:
      reports - Collection of Report objects to be exported.
      Returns:
      ZIP byte array with zip archives inside.
    • importReports

      Collection<Report> importReports(byte[] zipBytes)
      Imports reports from ZIP archive. Archive file format is described in exportReports method.
      Parameters:
      zipBytes - ZIP archive as a byte array.
      Returns:
      Collection of imported reports.
    • importReports

      Collection<Report> importReports(byte[] zipBytes, @Nullable EnumSet<ReportImportOption> importOptions)
      Imports reports from ZIP archive. Archive file format is described in exportReports method.
      Parameters:
      zipBytes - ZIP archive as a byte array.
      importOptions - - report import options
      Returns:
      Collection of imported reports.
    • importReports

      Collection<Report> importReports(String path)
      Imports reports from ZIP archive(s) by path. Path can point to the ZIP file directly or to some directory with ZIP files. Archive file format is the same as produced by exportReports.
      Parameters:
      path - path to archive file or directory
      Returns:
      Collection of imported reports.
    • importReports

      Collection<Report> importReports(String path, @Nullable EnumSet<ReportImportOption> importOptions)
      Imports reports from ZIP archive(s) by path. Path can point to the archive file directly or to some directory with archive files. Archive file format is the same as produced by exportReports.
      Parameters:
      path - path to archive file or directory
      importOptions - report import options
      Returns:
      Collection of imported reports.
    • importReportsWithResult

      ReportImportResult importReportsWithResult(byte[] zipBytes, @Nullable EnumSet<ReportImportOption> importOptions)
      Imports reports from ZIP archive. Archive file format is described in exportReports method.
      Parameters:
      zipBytes - ZIP archive as a byte array.
      importOptions - report - import options
      Returns:
      import result - collection of updated, created reports
    • importReportsFromPath

      Collection<Report> importReportsFromPath(String path) throws IOException
      Import all reports from the specified folder. Folder should have the following structure, in other cases RuntimeException will be thrown

      folder sub-folder1 report.structure template.doc sub-folder2 report.structure template.docx

      Parameters:
      path - to folder with reports
      Returns:
      collection of imported reports
      Throws:
      IOException - if any I/O error occurs