Create Report from commandline

  • Oliver Hohl

    Oliver Hohl - 2006-10-30


    first of all thank you for this really interesting product!

    I tried it a few times and it looks quite good for us. The only
    thing we would need is a way to create reports based on a formerly
    made .xml file from the command line.

    Is there any way to accomplish this?
    So that you could create a report with openrpt, save it as a xml
    file and afterwards call a command line program without having to
    have a x-session to create a printable version of that report.

    I would appreciate any answer on that.

    Thanks in advance


    • Chris Ryan

      Chris Ryan - 2006-10-31


          Unfortunately the way Qt's rendering/print engines work they require an x-session on linux for rendering the fonts. Because of this you won't be able to use any of the existing tools to render reports from a server process or other environment where an x-session environment is not present.

          If you have an x-session and just need to be able to script printing from the command line then you can either write you own progam to process reports using the renderer library or you could use the rptrender application. With the 2.0 version the rptrender application has a number of command line arguments that it supports for loading and printing reports with different levels of user interaction depending on the arguments giving on the command line.

          I hope this helps give you a better idea on what you are working on.


    • wuonm

      wuonm - 2007-02-04

      I didn't found the command-line parameter to print to PDF instead of to a printer. Does it exist? If not, any plan to add it soon? IMHO the ability to run the render from the command line is one of killer features if you manage lots of reports.


      • Chris Ryan

        Chris Ryan - 2007-02-20

        The code to print to pdf from the command line options was recently submitted and added to the rptrender application recently. It is in the latest CVS code for your use now.

    • Michael Hipp

      Michael Hipp - 2007-08-21

      Can anyone give me some examples of command-line usage with RPTrender (or a pointer to some documentation)?

      I've looked at the stable source and I think I can see what the available options are, but haven't yet been able to get it to run 'fonts.xml' as mentioned in this thread: .

      Usually it does nothing but put up the "login" window or else it just dies with "Unable to load the database driver".

      Here's an example of the sorts of command line options I've tried in various combinations...

        rptrender.exe -noauth -pdf -databaseURL="" fonts.xml

      I'm on W2k at the moment using 2.2.0 .


      • John Rogelstad

        John Rogelstad - 2007-08-22

        There is a user guide for OpenRPT at the xTuple downloads site with information about ODBC and run time switches.  Hopefully that should get you pointed in the right direction.  xTuple downloads can be found here:

    • Michael Hipp

      Michael Hipp - 2007-08-22

      Thanks. That's the User Guide I've been using but never thought to look in the ODBC section as I'm not using ODBC.

    • Anonymous

      Anonymous - 2007-08-24

      Somewhat off topic but what the hell,

      If when opening a database that contains an OpenRpt table why why not throw up a report selection form as opposed to having to ferret around creating an xml file?

      I think I'll play with this - essentially the code is there - just a question of calling it

      • Ned Lilly

        Ned Lilly - 2007-08-24

        Hi Chris,

        You might want to take a look at our PostBooks project ( - a full ERP/accounting/CRM system that includes an embedded OpenRPT.  It does just what you're talking about, under System / Master Information / Reports.


      • John Rogelstad

        John Rogelstad - 2007-08-24

        Actually the code already exists to do this.  It was sponsored by an xTuple customer and is documented on our Issue Tracker log at  It hasn't been documented in our help files yet, however.  You can now select a report out of the database from the RPTRender File menu, or pass a command line argument -loadfromdb={reportname} to load a report from the db.

        Note this is designed to work directly with the xTuple PostBooks/OpenMFG client, but it would work with any application that had a table called "report" that had the same data structure as the xTuple application.  To see the report table structure, you can download a copy of the database schema from the PostBooks project on SourceForge.



Log in to post a comment.