Reports are accessed from the report page
Some of the report options require syntax that may not be immediately intuitive. These are documented below:
Example in SQL:
Order by $order
Example in header:
Report sorted by $order_label
Variables can be specified in the following format:
Type Name Prompt [Default]
(Default is optional)
If your items have spaces in them, they should be enclosed in quotes:
DATE mydate "Enter a date"
Example:
PICK order "Sort report by"
added_by "Who added the record"
changed_by "Who last changed the record"
dob "Date of Birth"
ENDPICK
You can also populate your PICK list with an SQL query. Place SQL on one line, then your query on the next, and then ENDSQL on the next line. The query should return two fields--value and label.
Example:
PICK program "Report for which program"
"" "All Programs"
SQL
SELECT l_program_code AS value, description AS LABEL FROM l_agency_program
ENDSQL
ENDPICK
You could then use this in your SQL query like so:
SELECT ... FROM ...
WHERE agency_program_code=COALESCE('$program',program_code)
Each report consists of a general report record, plus one or more report blocks, which are separately configurable and has its own SQL statement.
Exanple:
SELECT staff_id,
username,
added_by,
changed_by
FROM staff
ORDER BY $order
Fields starting with _ will not be shown on the screen, but will be available
for output merges.
A common use is something like:
SELECT client_id, client_name(client_id) AS _name FROM client...
The client_id displays on screen as a client link, but gets exported as an id. The _name field will export to a spreadsheet or other merge document
Reports by default have options for
Output allows you to specify additional templates to merge with your report. These templates have been used to create:
Each additional template is specified on one line Specify a file name for the template, and a label for the user, separated by a | character:
sample_template.sxw|Choose this template
sample_template2.sxw|Here is another one