Importing and exporting Report Projects

Because BIRT Report Projects are simply a collection of report design files, the importing and exporting options available in Eclipse are not entirely useful. However, there are a few options that can be used for backup and restoration purposes. The following examples will look at exporting a project to an archive file and restoring it with the Import option.

Let's say that we need to archive the Classic Cars project that we have been building in the book. We will want to archive this as a ZIP file to C:TempClassicCars.zip. In order to do this, we need to right-click on the Project directory or the report file we want to archive and select the appropriate option. So, in this case we will use the Class_Cars_BIRT_Reports project. We will then specify the archive file(s) to include in the archive.

  1. From the Navigator pane, right-click on the Class_Cars_BIRT_Reports project and select the Export... option. You can also select the Class_Cars_BIRT_Reports project and, under the File menu, select the Export... option.
    Importing and exporting Report Projects
  2. Under the General option, select Archive File.
    Importing and exporting Report Projects
  3. From the Archive File editor, make sure the Class_Cars_BIRT_Reports project is checked. Make sure the files we want archived are also checked.
  4. In the To archive file textbox, enter the path. This can be done by using the Browse button or by manually entering the path. In my case, I will enter C:TempClassicCars.zip.
  5. Make sure the Save in zip format and Create directory structure for files options are selected. This will make sure that the directory structure is identical for the entire project when we extract the archive. If the Create only selected directories option is selected, only the files with a checkmark next to them will be selected, and this example shows a complete export. The.zip format is supported across multiple platforms, so I usually suggest this over .tar.
    Importing and exporting Report Projects
  6. Click Finish.

    Now you have made an exported archive of the project. Let's say that we received this archive and wanted to work with these report files. We would need to import the project into our Eclipse workspace. Fortunately, the process for doing so is very similar to exporting.

  7. Right-click on the Navigator and create a new Report Project called Classic Cars Copy.
    Importing and exporting Report Projects
  8. From the File menu or by right-clicking in the Navigator, select the Import... option.
    Importing and exporting Report Projects
  9. From the General branch of the tree view, select Archive File.
    Importing and exporting Report Projects
  10. In the dialog, enter C:TempClassicCars.zip as From archive file. We can also use the Browse button to find the archive file.
    Importing and exporting Report Projects
  11. From the Into folder textbox, make sure the Classic Cars Copy project is selected.
  12. In the case of this archive, I want to deselect the / directory and the Class_Cars_BIRT_Reports folder. I just want to select the files that are under the Class_Cars_BIRT_Reports folder. This is due to the archive option that created the folder structure. So, I will deselect both folders and manually select the files under the file listbox.
    Importing and exporting Report Projects
  13. Click Finish.

We also have the option to choose to import Existing Projects into Workspace and choose archive file, but this will use the exact same project name. For this example, we already have a project titled Classic_Cars_BIRT_Reports, so this import would fail if we do not delete the project. I won't show this here; just keep in mind that if we are copying a project or group of projects into a workspace, we can use the Import Existing Projects into Workspace option.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset