Set-up Screen Reports
Set-up Screen Reports
Screen Reports created by writing and storing SQL query in gb_report_queries table. Location fields control which screen report available on.
Can also use xlsx, docx, and pdf outputs for screen reports. Refer to Set-up Screen Report Templates page for steps required after creating screen report.
Creating Queries
Links to pages providing query details:
User Defined Queries
Encrypted Fields
Office(xls) Format
Office(xlsx) Format
Derived Fields
Libraries available for use in screen reports:
payroll_advice
quote
Default Reports
Standard entries stored in gb_report_queries:
Sample Table Population
Screen reports can be set up on screens listed below with required configuration:
Field Descriptions
report_query_id
Mandatory / Optional: Auto
Description: System allocated unique identifier.
module
Mandatory / Optional: Optional
Description: Enter module that screen report will generate from. Supported: 'qt', 'fm', 'gl', 'sp'. Records not used in system screens added with 'null' entry.
page
Mandatory / Optional: Optional
Description: Enter screen that screen report will generate from. Refer to Sample table population section for examples. Records not used in system screens added with 'null' entry.
sub_page
Mandatory / Optional: Optional
Description: Enter tab that screen report will generate from. Refer to sample data section. Records not used in system screens added with 'null' entry.
name
Mandatory / Optional: Mandatory
Description: Enter report name as one word in lower case. Example: orderfile. Name shown in screen selection drop list in proper case (Order File). Each name on page must be unique (cannot have two reports with same name on same screen). Name also used as default file name with key id appended. Example: navigating to Contracts / Order and selecting Order File for contract 108978 creates file 'orderfile108978.xls'. Use output_filename_alias field for different output file name.
description
Mandatory / Optional: Optional
Description: Enter report description for reference. Not displayed on user screens.
query
Mandatory / Optional: Mandatory
Description: Store SQL query required to generate report. Query must be valid. Visit User Defined Queries for query building information and derived field libraries for calculated fields. Standard query delivers system regular logo and presentation. Visit Office(xls) format if modifying standard report look. To return details for contract displayed on screen, query must contain markup: WHERE contract_id = '#t1.contract_id#' (Table Alias must be t1). Can set up query delivering multiple records, but not usable with form as placeholders only return data for first record, may not be displayed contract. If invalid components cause report failure, alert 'Nothing to report!' appears on screen. Contact Catch-e to resolve. Message also appears if no transactions for chosen contract.
template_id
Mandatory / Optional: Optional
Description: Currently non-functional.
file_id
Mandatory / Optional: Optional
Description: If blank, default screen report outputs available: Office(xls) as PDF, Office(xls), Text(CSV). To create Office(docx) or Office(xlsx) template for screen report, visit Set-up Screen Report Templates page for required steps. Last step adds file_id record created here.
output_filename_alias
Mandatory / Optional: Optional
Description: Add entry if output file name different to stored name. Can use placeholders for any fields in stored query. Example: 'orderfile#contract_id#' or 'orderfile{contract_id}' displays Order File 100000 in selection list and generates file 'orderfile100000.xls'. Some placeholders with prohibited characters (/ \ : ? " < > |) replaced with underscores. Works with placeholders containing illegal characters such as / \ : ? " < > |, prohibited characters replaced with underscores "_".
print_format
Mandatory / Optional: Mandatory
Description: Enter which print formats available to users when report printed from screen. Refer below for print format list.
status_flag
Mandatory / Optional: Mandatory
Description: If 'active', report visible on specified screen. If 'inactive', hidden.
Print Format Options
Useful Queries
Show Current Screen Reports
select rq.report_query_id, rq.module, rq.page, rq.sub_page, rq.name, rq.print_format AS print_format_xls, rq.status_flag from gb_report_queries AS rq ORDER BY module DESC, page DESC, sub_page DESC, name DESC Notes
Module identifiers: qt (Quotes), fm (Fleet Management), gl (General Ledger), sp (Salary Packaging)
Table alias in WHERE clause must be t1 for standard screen reports
Placeholders format: #field_name# or {field_name}
Dates using dd/mm/yyyy format: forward slash "/" considered prohibited character
Query must be valid SQL to execute without errors
Multiple record queries work but not with forms (placeholders only return first record data)