None Blocking Reports
Abstract
Many of the reports that can be added to Operator Suite require large amounts of data mining to produce the required output. As a result of this they often run for extended periods of time, occasionally timing out the web server. None blocking reports should solve this problem. The basic idea is that the user hits a button that starts the report processing in the background. The user can then continue on with other tasks and periodically check back to see if the report has finished processing, at which time the user can view the report.
Data Structure
- alter tblReports to contain a bit field named longReport.
- create tblReportTables with prtFileName varchar(128), rpttbl varchar(64), updateDate DateTime, lastRunTime int, bit running
- this table keeps track of the intermediate tables that each report is based on. These are pulled out of the .rpt file when it is imported.
- the rpttbl field holds the names of the intermediate tables. For each intermediate table there must be a stored procedure of the same name that updates it.
Associated Methods
import::
- insert the appropriate values in tblReports (if this is not a longReportthen terminate)
- load the report as a crystal reports object and use the DataStore.DataQueryString and parse it for the intermediate tables it is dependent on.
- add these to tblReportTables
update::
- set the running bit to true
- start the stored procedure running in a none blocking fasion
- make the line in the TreeList disabled (grayed out)
Update Finished::
- the stored procedure must update the table, set the last update date and running time fields and then set the running bit to false just before the stored procedure is terminated.
- once the running bit is false the row in the TreeList is enabled again and the user can click view to see the report.
Interface
Report TreeList
File Name | Report Title | Report Description | Creation Date | Last Updated On | Estimated Run Time | ||
report1.rpt | Report 1 | This report is likely to take a long time to generate | June 22nd, 2006 | Feb 12th, 2007 | 5 min | Update | View |
report2.rpt | Report 2 | This report will run quickly and thus doesn't need to be a longReport | July 10th, 2006 | ---- | ---- | ---- | View |