Overview of the Creation of a Report

The process of Editing a report is the same as creating a report except that the data has already been stored in the database and we are just modifying or adding records and the default data.

The first screen will configure the default values of the report, it's name, type, class, if Sub Entities or Sub Accounts (and the sub account types) are valid, number of dates to display max and min, if a date selection combo box is required, if a total column is required, what the default text and data font sizes are and the default foreground and background colors for the report. After creating or updating the entry in the report_type_tb, the process then proceeds to the next screen.

The report creation/editing script will output a frameset that has in the top frame the javascript code to edit/delete the data, the data that is being edited/created and the edit fields with all associated arrays of data (for account types, accounts, sub-accounts, reports, etc.). The bottom frame will display the created rows with edit and delete buttons that will allow the user to re-edit a row or delete it. The bottom frame will be re-created every time the contents are changed (adding, deleting or editing a row). (This is similar to what the transaction entry screen does but it uses layers instead.)

When the user wants to create a formula for the Total cell type, a window will be created via javascript that will present a list of all cell's that are currently created (that are before this cell) that will have values in them (all non-text cells). The user can then select a cell by clicking on the link and the cell's index will be added to the formula edit field. The user can select from a combo box what operator they would like to use and it will be appended to the formula field. The javascript should not allow multiple cell's or operators to be placed in the formula back to back. The contents of the formula field will be placed in the formula field in the top frame and the Formula Editing window will be closed when the user clicks ok. If they click cancel, the window will be closed and the contents of the formula field in the top frame will be left alone.

Overview of the Customization of a Report

The available reports to be run are displayed as follows:

All reports in the system are gathered and sorted by report_class.

The left combo box displays the Report Classes found and for each report_class selected, the reports associated with it are displayed in the right combo box. The last item will be Memorized Reports if there are any in the system. All memorized reports will show up in the right combo box when this item is selected.

When the user selects a report from the right combo box, the program submits to the report customization screen.



The report customization screen will read in the attributes from the report_type_tb for the selected report and use them to determine what the user can customize.

The user specifiable title will be displayed first.

The font size selections will be displayed next (side by side).

The font types that the data and text should be displayed in (side by side).

The length of the underline to be created. Default = 10 characters.

The foreground and background colors for the report will be displayed next (side by side - via combo boxes). This just overrides the default values for the global color scheme. If a cell has specified it's own color scheme, it will still be used for that cell.

The number of desired dates will be prompted for (ranges or single date values) and a date selection combo box will be displayed if specified. If the report specifies that there is a specific number of dates that must be filled in, then the first min_columns date fields will be marked as required via a (+) on the right side of the edit field.

The list of column headers will be parsed to determine what options are available for the user to select by to customize the report columns. Use a drop down combo on the left to display the possible column headers (if the string is not empty) where each header (other than none) will display the valid selections in the middle combo box. If the middle selection would need more specification, the right combo box will be filled in.

The precision of data combo box will be displayed last and defaults to 1.

A checkbox that signals if this report should be saved in the customize_report_tb table. The title of the report is used as the name to save under. If the report has already been saved with that name, then the user will be prompted to either overwrite or change the name.



If the report being run was pulled in from memorized reports, then the values that the user had saved will be used to select the current defaults for the customization screen. The user should be able to click on the Run Report button and have it do the same thing it did when they first ran and saved this report. The Save report checkbox will not be selected by default.



When the user goes to submit the customized values to the generate report script, javascript will be used to check for the validity of all entries that are required to make sure that they are filled in and that they appear to have valid data.

Overview of the Running of a Customized Report

When the generate_report script is run, it should have been called from a report customization screen or from a currently running report where we are running a sub-report. The specified report will be looked up in the report_type_tb and the passed in values will be validated to make sure that we have sufficient data to run the report. A frameset will be generated that has the top frame call the run_report script passing in the report to run and all customized values. If the customization screen specified to save the report, the report title will be used to see if this report has already been saved. The values the user specified will then be saved under this title name in the memorized_report_tb table.

The run_report script re-validates the passed in data and begins the process of gathering the data and then generating the javascript/html to work with the report.

Next all records in the report_data_tb for the specified report are gathered and massaged into the internal data format for the reports. Then the reporting array is walked and all data is gathered from the top down. All formulas can only reference items above themselves, therefore the forward referencing problem is non-existent. The resulting "report" is then outputted in the necessary javascript arrays/hashes with the necessary code to display the report along with the HTML to allow the user to print the report or open/close all level 0, 1, 2, ... layers of the displayed report. The javascript will run the display_report function when the page loads which outputs the report in the bottom frame with the open/close arrows and hyperlinks that allow the user to change the look of the report. When the user selects print, the javascript will open a new window and output the report in the current look without any hyperlinks or open/close arrows. This will be a printable version of the report. All views of the report will be displayed with the specified font sizes and foreground/background colors that the user specified for the report. If the report_type is regular then the report will display top down, but if it is detailed then the report gathers the data and displays it as the transactions (with the transaction id linked to the journal view script) with links at the top of each column to allow the user to sort each column and redisplay the detailed view based upon the results of the changes. The top frame will not have the open/close levels links as levels will not be used at this point. Just a print button.

If the user selects a link, then the specified report is submitted to the generate_report script with the necessary parameters to run with. These would be the date or dates to work with, the format of display sub-entities or sub-accounts, the sub-entities or sub-accounts to work with, the account type, account, sub-account, etc. that we are working with.

When a total cell is encountered the cell above it will be underlined. When drilling down into Account Types, any accounts displayed for that Account Type will have their total underlined, the same for the sub-accounts of an account.



Report classes should work like this:
Balance Sheet:
If first digit == 5
use false in sum activity function
else
use debit increases flag
Income Statement
always use false in sum activity function

Cash Flow
If acct_type = Cash
     use TRUE in sum activity function
else
     use false
(checking on liabilities)
with liabilities (first digit ==2) money essentially is given to us. It should affect cash positively.
Debit increases flag on 2 is false
if sending false to activity sum function will take credit - debit. This should show up as properly positive numbers.


Custom
Use debit_Increases Flag


Copyright (c) 2001 HLR
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; A copy of the license is available at http://www.gnu.org/licenses/licenses.html#FDL.

Updated: $Id: reports_design.html,v 1.2 2001/10/15 19:47:51 moreejt Exp $