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.
    • 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