This example in this section is based on the RNA-Example.xla addin and a report that uses the addin. See Extension Example to download, install and work with it while reading this section.
An Add-in must meet 5 requirements to qualify as a valid ReportsDNA Extension.
The add-in's filename must begin with RNA-
The extension add-in must have a reference to the ReportsDNA add-in.
It must contain a public function named RNA_PROPERTIES
It must contain a public function (e.g., SHOW_CONFIG), which will be called to allow a user to set the report's settings.
Optional - A subroutine to save the extension-specific report settings.
It must contain a public function (e.g., GET_DATA), which will be called to generate or retrieve the source data for the report.
Create an Excel Add-in that meets these requirements:
#
Requirement
Description
1
Filename
The Add-in's filename must begin with the letters RNA-
Example: RNA-HelloWorld.xla
2
Create reference to ReportsDNA
Create a reference to the ReportsDNA Add-In to enable calls to the ReportsDNA interface. This is required to set and get extension-specific report settings.
Steps 1. In the Excel menu, click Tools | Macro | Visual Basic Editor
2. In the Microsoft Visual Basic Editor menu, click Tools | Reference
3. Check the box next to ReportsDNA
3
Function RNA_PROPERTIES
Purpose A function called by ReportsDNA to register the extension.
Remarks The extension must contain a public function named RNA_PROPERTIES that returns a Dictionary Object.
Purpose A function that allows a user to configure report settings needed by the extension to generate the report. For example, for a database, this function may display a form that allows the user to enter the database name, user name and password.
Remarks This function is called by ReportsDNA when a user clicks on the extension name in the Source listbox.
The name of the function does NOT have to be named SHOW_CONFIG. The name is set by the extension author in the RNA_PROPERTIES function.
Mandatory: Yes
5
Subroutine SUBMIT_CONFIG
Purpose A function that calls ReportsDNA functions to save the extension-specific report settings. It is the function called when the user submits the report settings for the extension.
Remarks This function is NOT called by ReportsDNA. It is included here to provide a complete example of an example.
The name of the function does NOT have to be named SUBMIT_CONFIG.
Mandatory: No
6
Function GET_DATA
Purpose A function that generates or retrieves the source data for the report.
Remarks This function is called by ReportsDNA when the user generates the report.
The name of the function does NOT have to be named GET_DATA. The name is set by the extension author in the RNA_PROPERTIES function.