Collapse AllExpand All

4.4. Saving to a Database

Next we will save the XML report definition to an xTuple database. With the report definition loaded into the report writer, select the Save to DB option from the Database drop-down menu, as shown below:

Saving report definition to database

In this example we are connected to an xTuple database, a large number of report definitions are already stored on the database. The complete list of stored report definitions appears in the next screen, which appears after we select the Save to DB option from the Database drop-down menu:

Save Report to Database with a higher grade

xTuple can only generate reports using report definitions which are saved to its database. To distinguish between different versions of a report definition, the report writer employs grades. By default, xTuple uses the report definition with the highest grade.

Tip

Standard xTuple report definitions are delivered with a grade of "0". By default, the xTuple client runs the highest numbered grade. To ensure that you can always return to the baseline version of a report, save your report definitions with a grade higher than "0".

Because our xTuple database already contains one version of the UsersMasterList report definition, let’s save our current version with a grade of 50. This will clearly mark our current version as the default version xTuple should use. To see the two versions with their different grades, open the Load from DB option from the Database drop-down menu. The following screen will appear:

Note multiple grades for a single report

Keep in mind once again that xTuple will use the UsersMasterList report definition with grade 50 when executing this report.