Table structure needed to save report in db

  • saphire


    I want to save prepared OpenRPT report into PostgreSQL database but OpenRPT needs "relation". What tables do I need to create and with what structure?

    • Chris Ryan
      Chris Ryan

      At a minumum you need a table called report with with the following information:

      create table report (
        report_id serial primary key, -- unique id (must be auto assigned)
        report_name text, -- the name of the report on the database
        report_descript text, -- a description of the report on db.
        report_grade integer not null, -- a positive integer (rank with higher number equals better)
        report_source text -- the xml text of the document

      The report renderer will take a name and try to load a report from the database with that name that has the highest grade. This allows multiple versions of a report to be on a database at a given time with the same. For software vendors it can be used as a means for customers to customize database reports while allowing the vendor to be able to upgrade reports without overwritting a customers changes.