OSIS Cookbook – Adding a Quick Select List To a Report
Recently, while working on a feature for next release of OSIS I started thinking about how similar functionality could be achieved via existing versions of OSIS. In this case I am refering to the ability to add a quick pick type filter to an OSIS report. Here is what I came up with.
Requirements
- OSIS 2.4 or greater
- Experience in creating OSIS reports
- Knowledge of Javascript and SQL would be helpfull
Overview
The basic method was to utilize two standard OSIS reports, using one for the content of the main report with the chart while using the other to drive the pick list. I threw in a little html and Javascript kung-fu to make each work in conjunction with each other.
The Steps
The main report with chart
- Create an OSIS report utilizing the Work Request (wr) table as the basis for the report using the OSIS Create and Edit Reports tool
- On the Report Classification, Headers and Titles pane we will need to set both a custom Report Header and a custom Page Footer
- The Report Header is a series of links (two in this case) using standard HTML that will provide a link to the pick list report (created later) and allow the user to clear any applied restrictions in the main report. Take note of the report ID which in my example is 376 as this will need to be changed to the ID of the next report we will create.
- The Page footer contains a style definition to hide various parts of a standard OSIS report such as the title, footer, and header information. I have included it in this sample in order to make a cleaner looking report.
<style> #rpt_title_wrapper, #rpt_pageheader_wrapper, #rpt_pagefooter_wrapper, .rpt_chart_control_wrapper { display: none;} </style>
- Add three report fields one based on the prob_type field, one on the wr_id field and one on the bl_id field. Once saved you can edit each based on the following settings
- For Building Code Field
- For Problem Type Field
ISNULL(wr.prob_type,'None Assigned')
- For Work Request Field
Note: For this field I have used a UDF and named the field as a UDF. The outcome would be equally as effective if you used the wr_id field directly.
wr.wr_id
- Specify report features
The secondary report for the pick list
- Create an OSIS report utilizing the Building(bl) table as the basis for the report using the OSIS Create and Edit Reports tool
- Add a single field to the report based on the Building Code (bl_id). This field, after saving the report, will utilize the UDF statement contained in this file: udf_for_building_code_field










