Customize Parameters UI

Users are able to customize the Paramters UI by creating a HTML page.
*Note: HTML must be placed in the same repository as the rml report. And it must also be named the same as the report.
eg.
Report Name: Test.rml
HTML Name: Test.rml.html

Please refer to the attached sample: CustomizeParameterUI.zip

Fetch data from Database using JQuey and XML to populate the dropdown list

Please refer to the attached sample: parameters.zip
To avoid mapping, please place the “paramters” folder into ElixirWorkspace filesystem like this, <ElixirWorkspace/parameters>
Do not modify the js file in the resource folder.

Steps:
1/ Place parameters folder into ElixirWorkspace
2/ Restart Repertoire Server
3/ Go to Repository > ElixirWorkspace > parameters > parameters.rml
This will invoke the HTML parameters page.
Refer to the “Choice” field to see the options populated dynamically from “Fruitsales.ds”

We would advise that you try out this sample using Firefox with the Firebug plug-in installed so that you can see the JQuery script running on debug at the console level.

Things to take note:-

1/ This example uses the tabular data source in the samples directory but you can substitute it with a JDBC data source for your own actual implementation.

2/ Notice the choice values are duplicated.
Please implement a “select distinct…” query to return the ID data set when using a JDBC data source. Or you can create a composite ds to remove the duplicates

3/ Modify the ‘records’ function when selecting a column to populate the field, e.g.
$(records).each(function() {
var field = $(this).child()[1] ← determines column number (1st column is index 0)

4/ The customized parameter page is required to be deployed in the same directory as the report template and the HTML file has to share the same file name as the report template

5/ A more detailed explanation on the JQuery approach can be found here:
http://think2loud.com/288-using-jquery-and-xml-to-populate-a-drop-down-box/

parameters.zip
CustomizeParameterUI.zip