Differences between revisions 2 and 3
Deletions are marked like this. Additions are marked like this.
Line 65: Line 65:
  || '''fieldName''' || ALL || Use instead of ''fieldTag'' in header || E.g. ''"#"'' ||
Line 69: Line 70:
  || '''extLink''' || link || Use external link (pointing from the internal to the external system) if exists || Default: false ||
  || '''extraPar''' || link || Additional parameter calling the getLink method || getLink is called with ''$state, $depth, 'sho', $extraPar'' ||
  || '''refTable''' || reference || Name of referenced table || Default e.g.: ''fieldKey'' = "projectPhaseId", ''refTable'' = "ProjectPhaseRef" ||

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

      fieldName

      ALL

      Use instead of fieldTag in header

      E.g. "#"

      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

      extLink

      link

      Use external link (pointing from the internal to the external system) if exists

      Default: false

      extraPar

      link

      Additional parameter calling the getLink method

      getLink is called with $state, $depth, 'sho', $extraPar

      refTable

      reference

      Name of referenced table

      Default e.g.: fieldKey = "projectPhaseId", refTable = "ProjectPhaseRef"

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

Copyright 2008-2014, SoftXS GmbH, Switzerland