You may add a parameter to select and print a list of the debtor (customer / client) accounts which are linked to specific reporting groups only. 

reportman-parameters-groups-debtor


To add the Check list box parameter for Reporting group 1:

1.On the "Report man" screen, select your report and click on the Parameters button.

reportman-parameters-add

2.On the "parameters" screen for your report, click on the Add button.

reportman-parameters-groups-add-control

3.Select the options as follows:

a)Type of control - Select "IC CheckListBox".

b)Size and position - Enter the values for the Left, Width, Top and Height properties to position your parameter.

c)Translation - Click on the ... icon and search for the language label. Select your label (in this example, "Reporting group 1" is selected) and click Ok.

4.Click on the Save and rebuild button. This will position an empty "IC CheckListBox" on the "Parameters" screen. 

reportman-parameters-groups-add-column

5.Enter the following options: 

a)Column origin - To link the groups, you need to assign a valid column (database field) WREPORTINGGROUP1ID 

b)SQL - Enter "GROUPS22". This is the "WTYPEID" for "Debtor group 1" in the "V_TYPES" table.

Note the SQL must be entered in the Plural followed by 22 and entered in UPPERCASE i.e. GROUPS22. If this is not entered correctly, it will not list the "Debtor groups 1", but display "SQL error".

See - Reportman - References - Groups for a list of all Reporting groups in the V_TYPES table. 

6.Click on the Save and rebuild button. This will populate the Reporting group 1 for debtor (customer / client) accounts, if the SQL and the reporting group ID is assigned correctly. 

7.Click on the Save button to save your parameter and to close exit the "parameters" screen. 

If you do not click on  the Save button, your parameter or any changes to the parameter will be discarded (lost).


Add Groups parameter to the report

Once the Parameter is set on the "report options" screen, you need to add and define the parameter in the report. 

The basic process is as follows:

1.Add a String substitute parameter and assign the parameter to a dataset. 

2.On the dataset, you need to add SQL ("@REPOGROUP1@") to reference Report group 1.


To add the Check list box parameter for Reporting group 1 to the report:

1.On the "Report man" screen, select your report and click on the Edit button. (You may also double-click on your report).

reportman-parameters-groups-add-to-report

2.Click on the Database connections and datasets icon. 

3.Click in the Parameters button.

4.On the "Parameter definition" screen, select the "ACCOUNT" dataset and click on the Add icon.

5.On the "New param" screen, enter "WREPORTINGGROUP1ID".

This is the ID to Reporting group 1 as set in the "Column origin" field of the Parameters.  This needs to be entered in the UPPERCASE without any spaces (i.e. WREPORTINGGROUP1ID). If this is not entered correctly, it will display "SQL errors".

6.Click Ok. This will add the parameter. 

7.Select the "WREPORTINGGROUP1ID" parameter.

reportman-parameters-groups-add-dataset

8.On the "WREPORTINGGROUP1ID" parameter select and configure the options as follows:

a)Data type - Select "String Substi." (String substitute).  

b)Properties - Select (tick) the "Never visible" option. The other options may be left blank. 

c)Description - Enter a description ("Reporting group 1" as per this example).

d)Sets this parameter to - Enter "@REPOGROUP1@".  Click on the ... icon and search for the language label. Select your label (in this example, "Reporting group 1" is selected) and click Ok.

e)Assign to datasets - Assign to the ACCOUNT dataset. 

9.Click OK on the "Parameter definition" screen.

10.On the "ACCOUNT" dataset, enter "@REPOGROUP1@" as defined in the "Sets this parameter to" field of the "Parameter definition" screen.  

reportman-parameters-groups-add-sql

The "@REPOGROUP1@" in the "ACCOUNTS"  must be entered BEFORE the "Order by @ORDER" sort sequence SQL. If entered AFTER the "Order by @ORDER" sort sequence SQL, it will produce a similar SQL error:

"ACCOUNT :Dynamic SQL Error
SQL error code = -104
Token unknown - line 8, column 2
and

11.To verify that this parameter SQL is entered correctly and on the right place, you may click on the Show data button of the "Database connections and datasets" screen. 

12.Click OK on the "Database connections and datasets" screen.

If you do not click on the OK button of the "Database connections and datasets" screen, your parameter or any changes to the parameter will be discarded (lost).

13.Close the "Report manager designer" screen. Remember to Save the report. 

Whenever you close the "Report manager designer" screen, after editing your report, remember save the report. If you click on No, on the "Save report?" confirmation message, your changes will be discarded (lost).