Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
== Overview == = Overview =
Line 9: Line 9:
== Classes and Files == = Classes and Files =
Line 25: Line 25:
== Database Model == = Database Model =
Line 31: Line 31:
== Configuration == = Configuration =
Line 33: Line 33:
=== Configuration of report types and fields available for reports === == Configuration of report types and fields available for reports ==
Line 41: Line 41:
 || Index || Description || Example ||  || '''Index''' || '''Description''' || '''Example''' ||
Line 49: Line 49:
  Different type of fields can be defined:  Different type of fields can be defined:
Line 51: Line 51:
 || Field Type || Description ||
 || direct || The field is an element of the class defined in "setClass" above ||
 ||
 
 || index || description || notes, examples ||
 || fieldType || type of the field || see above ||
  || '''Field Type''' || '''Description''' ||
  || '''direct''' || The field is an element of the class defined in "setClass" above ||
  || '''link''' || The field is a link to display the referenced element of the set "setClass".<<BR>>The link is obtained by the getLink method ||
  || '''reference''' || The field is foreign key. Field(s) from referenced record can be displayed ||
  || '''file''' || The field contains a link to a file ||
  || '''derived''' || The field composed specially by a defined method ||

 Individual field settings:

  In the following table ''fieldKey'' is the key of the field configuration settings, what in most of the cases the appropriate database field name without table name.

  || '''Index''' || '''Field Type''' || '''Description''' || '''Notes, Examples''' ||
  || '''fieldType''' || ALL || Type of the field || '''Mandatory''', see table above ||
  || '''fieldTag''' || ALL || Message catalog tag for the header || If neither fieldTag nor fieldName defined <<BR>> the ''fieldKey'' is used as tag ||
  || '''dispField''' || ALL || Displayed object field to be set || Default: ''fieldKey'' ||
  || '''sortField''' || ALL || Sort key in sort URL || Default: ''fieldKey'' with tablename, e.g.: ''Drawings.drawingCode'', <<BR>> in the case of ''reference'' type str_replace( '_', '.', ''dispField'' ) ||
  || '''class''' || ALL || Space separated list of HTML classes from ''displayClasses'' above || Default: align_center ||
  || '''classPriv''' || ALL || Set private class on private object || Default: false ||
  

Generic Reporting

Overview

Generic reporting implemented to allow

  • the customers to create new document/task list views
  • us to easily customize document/task list views

Classes and Files

  1. Configuration file of all fields usable in generic reports
    • app/config/Settings-Reports.php
  2. Smarty templates to display the output of a report
    • app/tran/draw/list/DrawingListHeaderHeader.tpl - Drawing list view selection
    • app/tran/genrep/GenericReportHeader.tpl - Report header row
    • app/tran/genrep/GenericReportRecord.tpl - Report record rows
    • app/tran/genrep/GenericReportPrintHeader.tpl - Report header row (print format)
    • app/tran/genrep/GenericReportPrintRecord.tpl - Report record rows (print format)
  3. Administration
    • app/form/ReportForm.php - PHP form class for generic reports
    • app/js/report.js - backbone based javascript to add/remove/change report fields
    • app/tran/report - directories of the transactions
  4. Usage
    • app/lib/GenericReport.php - PHP class to instantiate generic report, read configuration, dereference object class

Database Model

  • ReportTypeRef - Report types, currently only one type: Document

  • Reports - Configured reports
  • ReportFields - Report field configuration for reports in table Reports

Configuration

Configuration of report types and fields available for reports

All report types and report fields available in reports should be configured first in app/config/Settings-Reports.php in $_CFG['GenericReport'].

  • ReportTypeRef.define is the main index in $_CFG['GenericReport'] to access to the definition of a report type.

  • The report type definition contains some generic settings and all field definitions

Note, that there are feature dependent settings at the end of the file, which can overwrite normal settings or add new fields

Generic Settings:

  • Index

    Description

    Example

    setClass

    PHP class the report based on

    DrawingsRevisionsJoinSet

    titleTag

    message catalog tag for report header

    documentList

    displayClasses

    array of HTML classes available for selection

    align_left, align_center, align_right, nowrap, font_bold

    fields

    array of field definitions, the key is used as ReportFields.reportFieldConfigName

Field Definitions:

  • Different type of fields can be defined:
    • Field Type

      Description

      direct

      The field is an element of the class defined in "setClass" above

      link

      The field is a link to display the referenced element of the set "setClass".
      The link is obtained by the getLink method

      reference

      The field is foreign key. Field(s) from referenced record can be displayed

      file

      The field contains a link to a file

      derived

      The field composed specially by a defined method

    Individual field settings:
    • In the following table fieldKey is the key of the field configuration settings, what in most of the cases the appropriate database field name without table name.

      Index

      Field Type

      Description

      Notes, Examples

      fieldType

      ALL

      Type of the field

      Mandatory, see table above

      fieldTag

      ALL

      Message catalog tag for the header

      If neither fieldTag nor fieldName defined
      the fieldKey is used as tag

      dispField

      ALL

      Displayed object field to be set

      Default: fieldKey

      sortField

      ALL

      Sort key in sort URL

      Default: fieldKey with tablename, e.g.: Drawings.drawingCode,
      in the case of reference type str_replace( '_', '.', dispField )

      class

      ALL

      Space separated list of HTML classes from displayClasses above

      Default: align_center

      classPriv

      ALL

      Set private class on private object

      Default: false

GenericReporting (last edited 2012-11-12 15:53:43 by C3E4A006)

Copyright 2008-2014, SoftXS GmbH, Switzerland