#### Example 1: Publishing a report to the versioning system

In this example, a task is set up and will be performed immediately. The generated result is asked to be kept for 30 days.

1. On the JReport Console > Resources page, select the report row, right-click in the row and select Schedule from the shortcut menu to display the Schedule dialog.
2. In the General tab,
   1. Specify a name for the task in the Schedule Name text box.
   2. For a page report that contains multiple report tabs, you need to select the report tabs you want to run from the page report in the Select Report Tabs section. Change the reports tabs order using the Move Up or Move Down button. Check the Export to One File option if you want to export the selected report tabs to one result file.
   3. If there are multiple dynamic connections available, expand the Select Dynamic Connection section and select a connection from the drop-down list. Click Connection Properties to view the connection information if needed.
   4. Expand the Report Information section, click Select Another Catalog to specify another catalog for the report if required.
   5. Select the report version and catalog version from the corresponding drop-down lists.
   6. Assign a priority to the task from the Priority drop-down list.
   7. Expand the Advanced section, if the report has a style group, check the Enable Style Group checkbox and choose the style group.
   8. Check the Enable Converting Encoding option if required and specify the encoding before and after converting from the corresponding drop-down lists.
   9. If Enable NLS is available, you can select it and then specify a language to display the report contents with.
   10. Define the encoding for the report by selecting from the drop-down list.
   11. Check Use the default DB user and password defined in catalog.
   12. Check the Add TaskListener to be Invoked option, and input the class name (for details, see Adding TaskListener).
   13. Check the Enable Auto Recover Task option to specify auto recovering settings.
3. In the Parameter tab, specify the parameter values as required if the report has parameters.
4. In the Publish tab,
   1. Click the To Version sub tab, then check Publish to Versioning System.
   2. Select the required formats and set the format settings.
   3. Check the Built-in Version Folder option in Archive Location to save the report result version in the built-in version folder.
   4. Set 0 for the Maximum Number of Versions.
   5. Check the Result Auto-delete option and define the result to expire in 30 days.
5. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone drop-down list, then from the Time Type drop-down list, choose Run this task immediately.
6. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and then set the settings.
7. If you want to specify a timeout for the task, specify the settings in the Duration tab as required.
8. Click Finish to have the task performed.

Then, click My Tasks on the system toolbar. While the task is being performed, you can see a record of it in the Running tab. On completion it will be put into the Completed tab.

Notes:

- When publishing a report to XML format, if you want to use the URL to get the .xsd file, follow the steps below:
  1. Put the existing XML schema file in `<intall_root>\public_html`.
  2. Input `http://IP address:8888/name of the existing XML schema file`.
- There is another way to publish the report result to version. If you have set the property server.version.from.temp to true in the server.properties file in `<install_root>\bin`, or selected the option Enable "Publish to Versioning System" for Background Tasks View on the JReport Administration page > Configuration > Advanced panel, you will get the link Publish to Version System on the system toolbar of the JReport Console page. Click the link to publish the result to version.