Custom Office/Crystal Tips and Tricks:
Adding User Security to Individual MAS 90 / MS 200 G/L Financial Reports
By Dan Burleson
Sage MAS 90 / MAS 200 Authorized Consultants Program
Adding my Crystal trick security feature will allow specified users to secure individual financial reports. My trick provides security (for the standard MAS 90 / MAS 200 General Ledger Financial Reports) that is not currently available to authenticate a particular financial report. Example: Currently in MAS 90 / MAS 200, rights can only be assigned to all financial reports or none. That can be altered by creating a Custom Office User Define Table (UDT) and by using it with minor changes to the General Ledger financial reports in version 4.0 and above.
This is a small enhancement, but requires knowledge of Custom Office and Crystal reports formulas and variables. It can be performed to multiple reports in just a few minutes.
Overview of Procedure
1. Step 1: Create a User Defined Report Security Table Using Custom Office
A. Create a field to hold the titles of financial reports to be secured.
B. Create a field to hold user logon codes of those permitted to run a particular financial report.
C. Enter the list of report titles with the user logon codes permitted to run them.
2. Step 2: Add to the Financial Report - 3 Formulas and 1 Sub Report Consisting of 1 Formula
A. Add an empty sub report based on the Report Security table created above.
B. Add a supplied formula to the sub report detail section’s “suppression conditional” formula area.
C. Add a supplied formula to the main report header section’s “suppression conditional” formula area.
D. Add a supplied formula to the Group Selection formula of the main report that enforces security.
E. Add a supplied formula to the Page Header section that displays an unauthorized message.
3. Step3: Set the Option to Print User Logons on Reports
A follow-up article will demonstrate how to incorporate additional security based on company code and account groups by expanding on this same technique.
Step 1: Create a Report Security Table Using Custom Office
|
|
|
|
|
|
|
Figure 1 – Adding a User Defined Table (UDT) to the Common Information module |
|
|
|
|
|
|
|
Figure 2 – Adding the “Report_Security” Common Information User Defined Table |
|
|
|
|
|
|
|
Figure 3 – Adding the User UDF to the REPORT_SECURITY UDT |
|
|
|
|
|
|
|
Figure 4 – Adding the REPORT_TITLE UDF to the REPORT_SECURITY table. |
|
|
|
|
|
|
|
Figure 5 – The resulting REPORT_SECURITY table User Defined Fields |
|
|
|
|
|
|
|
Figure 6 – Adding User and Report Data to the Report Security UDT |
|
|
|
|
|
|
|
Figure 7 – The resulting UDF containing report names with their authorized users |
Step 2: Modify the Financial Report
In this example, the Income statement will be used, but the same technique can be used for all of the financial reports.
A. Add the Sub Report called “ReportSecurity” to the Report Header
|
|
|
|
|
|
|
Figure 8 – Inserting the Sub Report in the Report Header |
When the Report Wizard begins, choose to base the sub report on the CI_UDT_REPORT_SECURITY table (added in step 1) as shown below.
|
|
|
|
|
|
Figure 9 – Base the Sub Report on the CI_UDT_REPORT_SECURITY table |
Add no fields to the sub report, remove any fields already on the sub report, and remove the “Report Header b” and “Report Footer b” if they existpro. Your report should look similar to the following example:
|
|
|
|
|
|
|
Figure 10 – The Added Sub Report has not fields and Only the Details Section is Unsuppressed |
It is also possible to save this sub report for re-use with other financial reports by using the “Save Subreport As” command while editing the sub report.
B. Add the Supplied Logic to the Suppression Conditional of the Sub Report Detail section.
The Formula Workshop program will start when the suppression conditional icon is clicked.
|
|
|
|
|
|
|
Figure 11 – Adding Logic to the Sub Report Details Section Suppression Conditional |
Enter or copy the following formula in the Formula Workshop as the Suppression Conditional.
|
|
|
|
|
|
|
Figure 12 – Adding Logic to the Sub Report Details Section Suppression Conditional |
C. Add the Supplied Logic to the Suppression Conditional of the Main Report’s Report Header
Using steps similar to those above, add the following logic to the Suppression Conditional of the main report’s Report Header.
1. Open the Section Expert from the main report.
2. Turn off the check box for Suppress Section.
3. Change the syntax to Crystal Syntax if Basic Syntax is selected by default.
|
Your formula should look identical to the following figure in the Formula Workshop dialog box.
|
|
|
|
|
|
|
Figure 13 – Adding Logic to the Report Header Section Suppression Conditional |
D. Add the Supplied Logic to the Group Selection formula of the Main Report
Any record selection logic added to a report that is initiated from MAS 90 / MAS 200 will be ignored, but you can add group selection logic that will not be ignored. The logic added in this step will not be used to eliminate individual groups, since nothing in the formula changes throughout the report. If the current user has not been permitted to run the report based on the Report Security table, it is used to eliminate all groups.
The string array “strReportTitles” is only filled with the titles of reports that the current user is permitted to run, and the logic below tests these against the title of the current report.
|
Your formula should be identical to the following in the Formula Workshop dialog box for Group Selection.
|
|
|
|
|
|
|
Figure 14 – Adding Logic to the Report’s Group Selection Formula |
E. Create a Formula with the Supplied Logic that Informs the User When Not Authorized
When an unauthorized user runs the report, they should not be presented with a blank report, but rather with a message that informs them of the reason the report is blank. This is done with a formula called “Unauthorized” and contains the following logic that tests whether any report titles were found to be permitted for the current user:
|
Your formula should be identical to the following in the Formula Workshop dialog box for the Unauthorized formula.
|
|
|
|
|
|
|
Figure 15 – Creating the @Unauthorized Formula Logic Using Crystal Syntax |
Add the @Unauthorized formula to the Financial Statement main report in the Page Header section “e” (PHe) and make it font style bold as shown below.
|
|
|
|
|
|
|
Figure 16 – Inserting the @Unauthorized Formula into the Main Report |
Step 3: Setting a Required Company Maintenance Option
1. Open the Company Maintenance program from within the Library Master module.
2. Select the Preferences tab.
3. Check the “Print User Logon Reports” check box.
4. Repeat this set for all companies for which financial reports will be printed.
|
|
|
|
|
|
|
Figure 17 – Setting the Attribute that Will Provoke the User Logon to be Passed to the Report |
NOTICE: This article represents copyrighted material and may only be reproduced in whole for personal or classroom use. It may not be edited, altered, or otherwise modified, except with the express permission of the author.
Dan Burleson is an independent Sage MAS 90 / MAS 200 Authorized Consultant located in Philomath, Oregon. He may be reached at info@connexsoftware.com or at (541) 754-7400.
© Connex Software. All Rights Reserved