newdevs:code:report-view
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
newdevs:code:report-view [2023/05/22 09:16] – tlittle | newdevs:code:report-view [2023/07/27 12:44] (current) – [Making This a Core Report Source] tmccanna | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Create a View in the Reporter | + | ====== Create a New Report Source |
- | If you have a need for data that can only be retrieved via a query because the reporter can't construct it, you can add that query to the fieldmapper | + | If you have a need for data that can only be retrieved via a query because the reporter can't construct it, or if you base numerous reports on a specific set of data that you don't want to have to rebuild every time you create a template, you can create a new class in the fieldmapper that can be used by the reporter going forward. |
- | 1. Scroll | + | First, you will need to construct a SQL query that retrieves the data you wish to make available in your source. Once you are satisfied, then you have two options: |
+ | |||
+ | ===== Option | ||
+ | |||
+ | This option adds the SQL directly to the Fieldmapper. This is the easiest approach | ||
+ | |||
+ | Tasks: | ||
+ | * Create new fieldmapper class (this will include the SQL query) | ||
+ | |||
+ | Example Code: https:// | ||
+ | |||
+ | |||
+ | ===== Option 2: Create a Database View ===== | ||
+ | |||
+ | This option creates a view on the database side which is then referenced by the fieldmapper | ||
+ | |||
+ | Tasks: | ||
+ | * Create | ||
+ | * Decide whether this should be added to an existing schema or if a new schema should be created. (In this example, a new schema is created.) | ||
+ | * Create or modify the appropriate schema file under Open-ILS/ | ||
+ | * Create an upgrade script under Open-ILS/ | ||
+ | * Create new fieldmapper | ||
+ | |||
+ | Example Code: https:// | ||
+ | |||
+ | ===== Making This a Core Report Source ===== | ||
+ | |||
+ | If unspecified, | ||
+ | |||
+ | <code> | ||
+ | |||
+ | For example: | ||
+ | < | ||
+ | oils_obj: | ||
+ | reporter: | ||
+ | |||
+ | ===== More Information ===== | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | **NOTE:** The Fieldmapper cares about indentation. Make sure to follow the indentation examples from other classes. |
newdevs/code/report-view.1684761378.txt.gz · Last modified: 2023/05/22 09:16 by tlittle