The command line import tool functions on all supported client environments and enables the importation of .xml report definitions over the network through a command line on a client computer. Systems administration personnel may embed the command line import tool in scripts that import multiple report definitions in a single run or use it iteratively from the command line.
The example provided in this document shows the command line report import tool being used on a Window client computer. The syntax is the same regardless of the operating system.
The name of the binary is importrpt (with the '.exe' extension on Windows) and should be collocated with the xTuple client application files. The listing below shows the command, as executed above, in a more readable fashion:
importrpt -databaseURL=psql://xTuple.application/newdemo:5432 -username=jsmith -passwd=js1app -f=C:\xTuple\report_xml\Routing.xml -grade=10
Let's take a look at all of the options available in importrpt to understand each a little better:
Table 5.8. Options available to importrpt
Option | Syntax |
---|---|
-databaseURL=<connection URL> | Specify the connection information that importrpt should use when loading a report definition. The connection URL is in the following format: psql://servername/database[:port] . In the connection URL, the servername is the host or IP address of the server where the database is running. For example: somehost.xTuple.com . The database is the name of the actual database you want to connect to on the specified server. For example: mydb . The last option, port , is optional. If included, it must follow a colon and be a valid port number. If the port is not specified, the default port of '5432' is used. For example, if you wanted to connect to the database mydb on the server somehost.xTuple.com using the default port, you would use the following connection URL: psql://somehost.xTuple.com/mydb . Similarly, if you wanted to connect to the database dbtest on the server 192.168.128.64 using the port 2345 you would use the following connection URL: psql://192.168.128.64/dbtest:2345 |
-username=<user name> | This is user name you are using to connect to the server and database. It is the same username that the user enters when logging on through the xTuple client and must be setup using the xTuple client session Maintain Users. |
-passwd=<password> | This is the password for the user name you specified in Maintain Users. This is the same password that the user enters when logging in through the xTuple client. |
-grade=<number> | The grade used to load a report into the database. A numeric value from "0" to "99" is valid. The default value is "0" if this option is not specified. Grade "0" should generally be reserved for the baseline report definition supplied by xTuple. |
-f=<report definition> | The name of the report definition file (as it appears on your disk) that you are loading into the database. The path may be included if the file is located in a directory that is different from the one in which importrpt is located and the syntax for the path will vary by operating system. |
You may have noticed that the report definition loaded in our example above was for the routing report and that grade was assigned a value of "20". If, after running importrpt, we start the xTuple report writer and browse the report definitions, we will find that we now have an additional report definition for the routing:
We can see that routing has three definitions: "0", "10", and "20". When a user runs the routing report, xTuple will use the definition with grade "20": the definition we just imported using the importrpt command line tool.