Home > Extensions > How to Create an Extension > SUB SUBMIT_CONFIG
SUB SUBMIT_CONFIG
Purpose
This subroutine is typically called when the user clicks the submit button on the form displayed by SHOW_CONFIG to obtain extension settings. The function calls ReportsDNA setExtensionProperty to save extension-specific report settings. Each extension typically has configuration properties that are used
by the extension to determine what data to return for the report. For
example, a database extension will likely require at least 4
properties: database name, user name, user password and query definition.
Description
The subroutine calls ReportsDNA.setExtensionProperty for each property needed to generate the report. setExtensionProperty will save the property as part of the Report's
configuration. It returns a boolean indicating if the value was set. The following details how to call setExtensionProperty to properly store a property.
Public Function setExtensionProperty(
a_propNumber As String, a_value As String, _
Optional propertyType As Byte = 0, _
Optional paramInterpret As String = "", _
Optional paramNum As String = 0, _
Optional paramLabel As String = "") As Boolean
The extension author must define the Property Type and the Property Interpretation Type for each property to specify how ReportsDNA will determine the property's value when the report is generated.
Extensions
may have up to 20 properties. The properties are numbered from 1 to 20
inclusive. The property number is a string data type.
The Property Type setting specifies whether or not the
property can contain a parameter and if so, the type of parameter:
static or dynamic. Static parameters are determined without user
intervention when the report is generated. Users are prompted to enter
the value(s) for Dynamic parameters each time the report is generated.
| Type | Value |
Description | Example Use |
| TYPE_NORMAL | 0 |
The property does not accept parameters. |
Property: Username Value: Hiprocates The username will never change so it is permanently set to Hiprocates. |
|
TYPE_STATIC_PARAMETER |
1 |
The property accepts parameters which are interpreted at the time the report is generated without requiring user input. |
Data Source: query defined below. The application will determine the value for [PARAM1] based on the property's interpretation type. SELECT * FROM ORDERS WHERE PURCHASE_DATE > [PARAM1] Example Value: July 1 The report will always return orders placed after July 1. |
|
TYPE_DYNAMIC_PARAMETER |
2 |
The property accepts parameters. The report will prompt the user to enter the value(s) for the parameters each time the report is generated. | Data Source: query defined below. The user will be prompted to supply the purchase date when the report is generated. SELECT * FROM ORDERS WHERE PURCHASE_DATE > [PARAM1] Example Value: User-specified each time The user specifies the date to be used when the report is generated. |
The Property Interpretation Type setting specifies how the property should be interpreted when processed. See the chart below for the different values for this setting.
| Type | Value |
Description | Example Use |
| INTERPRET_NONE | 0 |
The property's value will not be interpreted. Use this type when variable interpretation is not required. |
Property: Database Value: Defects The database name doesn't change; therefore, it does not require any special interpretation. The value specified by the user will be used. |
|
INTERPRET_REPORTSDNA |
1 |
Parameters will be interpreted using the ReportsDNA variable replacement definitions. |
Data Source: query defined below. ReportsDNA will replace [PARAM1] with [DATE]-7, which will be calculated at run time as today's date - 7 days. SELECT * FROM ORDERS WHERE PURCHASE_DATE > [PARAM1] User-specified value:[DATE]-7 Example Today's Date: July 8 Interpreted Value: July 1 |
|
INTERPRET_MACRO |
2 |
A macro (typically defined in the extension) which will return the value. |
Data Source: query defined below. ReportsDNA will assign the value returned by the macro specified for this property. SELECT * FROM ORDERS WHERE PURCHASE_DATE > [PARAM1] |
The property number that contains the value for another property that accepts parameters.
Example
Property 1 accepts parameters but does not prompt the user for the value at runtime (TYPE = TYPE_STATIC_PARAMETER).
Property 1 contains a query that requests orders purchased [PARAM1] days in the past ( SELECT * FROM ORDERS WHERE PURCHASE_DATE > [DATE]-[PARAM1] ).
Property 1 uses the value stored in Property 2 ( 7) as the default value for [PARAM1].
If run on July 8, Property 1 will be evaluated as follows:
SELECT * FROM ORDERS WHERE PURCHASE_DATE > [DATE]-[PARAM1]
SELECT * FROM ORDERS WHERE PURCHASE_DATE > July 8 - 7
SELECT * FROM ORDERS WHERE PURCHASE_DATE > JULY 1
| Property Number |
Type |
Interpretation Type |
Value |
Parameter Number |
| 1 |
TYPE_STATIC_PARAMETER |
INTERPRET_REPORTSDNA |
SELECT * FROM ORDERS WHERE PURCHASE_DATE > [DATE]-[PARAM1] | 2 |
| 2 |
TYPE_NORMAL | INTERPRET_NONE | 7 |
[nothing] |
Mandatory: No
Property Type = TYPE_DYNAMIC_PROPERTY (prompt for property value)
Prompt for property value when report is generated.

See also