When a report is executed, a filter execution dialog will appear if any of the filters on the report are set to ‘Prompt for Value’. This dialog can be replaced with a custom window created by the host application. The custom window can be either a control saved within Exago or a separate webpage outside of Exago
To create Custom Filter Execution Window as a control within Exago:
NOTE. Height and Width are numbers that represent the dimensions of the window in pixels. These settings are optional. If omitted, the dialog is sized to the value in the wrDialogMasterContainerCentered css class, which is currently 70%.
To create Custom Filter Execution Window as a web page:
NOTE. Height and Width are numbers that represent the dimensions of the window in pixels.
NOTE. To notify the host application the user’s language the URL will be appended with the ‘Language File’ of Main Settings and a context parameter (listed below). Ex. www.CustomFilterExecution.com?language=en-us
NOTE. all the JavaScript functions must begin with ‘parent.’ as the page is placed inside an iFrame by Exago.
The following JavaScript functions are available for the Custom Filter Execution Window.
object[] wrGetFilterWindowData()
Description |
Gets the report’s existing filters created in Exago as an array. |
Remark |
Returns an array of filter objects. For more information on the filter objects see wrReportFilter(). |
object[] wrGetFilterWindowDataObjects()
Description |
Gets the Data Categories of the report and their associated Data Fields. |
Remark |
Returns an array of representing the available Data Categories. DataType Constants: 1 – Date 2 – Integer 3 - Bit 4 - Numeric 5 - Float 6 - Decimal 7 - Guid 8 - DateTime 9 – Time - not currently used NOTE. All the Categories names being passed are the Alias for each Data Object. Similarly the Data Fields will return the name specified in column metadata if provided. |
string wrGetActiveReportName()
Description |
Returns the name of the report being executed. |
Remark |
The returned string includes the folder path of the report separated by slashes. |
bol wrShowFilterWindow()
Description |
Displays the custom filter execution window. |
void wrReportFilter()
Description |
Creates a Filter object that can be added to the Filters array returned by wrSetFilterWindowData(). |
Remark |
Filter Objects have the following properties: Name – The name of the data field being used. DataType Constants: 1 – Date 2 – Integer 3 - Bit 4 - Numeric 5 - Float 6 - Decimal 7 - Guid 8 - DateTime 9 – Time - not currently used 10 - Image |
bol wrSetFilterWindowData(object[] filters)
Description |
Sets the filters for the report, closes the custom filter execution window, and then begins report execution. |
Remark |
Returns a Boolean to indicate success. This or wrCancelFilterWindow() should be the last function called by the custom filter execution window. |
bol wrCancelFilterWindow()
Description |
Closes the custom filter execution window without changing the report’s filters. |
Remark |
Returns a Boolean to indicate success. This or wrSetFilterWindowData() should be the last function called by the custom filter execution window. |
<%@ Control Language="C#" ClassName="MyCustomFilterDialog" EnableTheming="false" %> <span>Hello Custom Filter Dialog</span> <input type="button" value="Ok" onclick="OnOk();" /> <input type="button" value="Cancel" onclick="OnCancel();" /> <script type="text/javascript"> OnOk = function() { // create array of wrReportFilter objects to send back to parent var filters = new Array(); var filter = new wrReportFilter(); filter.Name = "Employee.First Name"; filter.Operator = wrFilterOperator.OneOf; filter.Values.push("Travis"); filter.Values.push("Stew"); filters.push(filter); wrSetFilterWindowData(filters); // also continues execution } OnCancel = function() { wrCancelFilterWindow(); } // initialize custom window with values from the parent var filters = wrGetFilterWindowData(); var dataObjects = wrGetFilterWindowDataObjects(); wrShowFilterWindow(); </script>
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"></script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> window.onload = function() { Initialize(); }; function Initialize() { // initialize custom window with values from the parent var filters = parent.wrGetFilterWindowData(); var dataObjects = parent.wrGetFilterWindowDataObjects(); parent.wrShowFilterWindow(); } function OnOk() { // create array of wrReportFilter objects to send back to parent var filters = new Array(); var filter = new parent.wrReportFilter(); filter.Name = "Employee.First Name"; filter.Operator = parent.wrFilterOperator.OneOf; filter.Values.push("Travis"); filter.Values.push("Stew"); filters.push(filter); parent.wrSetFilterWindowData(filters); // also continues execution } function OnCancel() { parent.wrCancelFilterWindow(); } </script> </head> <body> <form id="form1" runat="server"> <div> <input type="button" value="Ok" onclick="OnOk();" /> <input type="button" value="Cancel" onclick="OnCancel();" /> </div> </form> </body> </html>