d9f6572aacbc7d39dea30ecd85f1af2079bd5a81
API/CodeSamples/Equals-Popup-Custom-Page.md
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +#Equals(Popup) Custom Pages |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +In order to use the [[EqualsPopupDestinations|/API/CodeSamples/EqualsPopupDestinations]] setting and the [[FiltersCustomPagesPath|/API/CodeSamples/FiltersCustomPagesPath]] settings, there is a procedure you must follow to get the reporting application to communicate with your custom page. More information about the above settings can be found on their respective pages. |
|
| 8 | + |
|
| 9 | +##Using Equals(PopUp) with custom pages |
|
| 10 | + |
|
| 11 | +To implement custom filters page you need to perform following steps: |
|
| 12 | + |
|
| 13 | +1. Create a separate folder in the root reporting directory for custom filters pages (say, "CustomFilters"), and set it in your AdHocSettings: |
|
| 14 | + `AdHocSettings.FiltersCustomPagesPath = "CustomFilters";` |
|
| 15 | + |
|
| 16 | +2. Now set the relationship between your custom filters page and the columns you will be using. You can assign several fields to the single custom filters page: |
|
| 17 | + |
|
| 18 | + `AdHocSettings.EqualsPopupDestinations["MyCustomFilter"] = new string[] { "Col1", "Col2", "ProductName", "CategoryName" };` |
|
| 19 | + |
|
| 20 | +3. Get the CustomFiltersTemplate page (.aspx and .aspx.cs files), which we can provide for you, and rename it to MyCustomFilter. Then you can paste it into the CustomFilters folder. |
|
| 21 | +4. In the MyCustomFilter.aspx page, add necessary controls between following lines: |
|
| 22 | +```html |
|
| 23 | + <!--Here is block with custom controls--> |
|
| 24 | + |
|
| 25 | + <!--Here is block with custom controls--> |
|
| 26 | +``` |
|
| 27 | +5. In the **MyCustomFilter.aspx.cs** file, locate the **WriteCustomControlsValues** method. It is called when the custom filters page is opened and should automatically obtain the existing values for that column from the application. In this method you should add code that updates your custom page's controls with the filtering values sent from the report designer: |
|
| 28 | +```csharp |
|
| 29 | + private void WriteCustomControlsValues(string columnName, string[] oldValues) |
|
| 30 | + { |
|
| 31 | + //In this method custom controls must be created and filled with old values |
|
| 32 | + _CODE_HERE_ |
|
| 33 | + } |
|
| 34 | +``` |
|
| 35 | +6. In the **MyCustomFilter.aspx.cs** file, locate the **ReadCustomControlsValues** method. It is called when user clicks "OK". Values from your custom page's controls should be passed to the ReportDesigner. In this method you should add code that gathers values from your controls and updates the list of strings with those values: |
|
| 36 | +```csharp |
|
| 37 | + private void ReadCustomControlsValues(ref List<string> selected) |
|
| 38 | + { |
|
| 39 | + //In this method list of new values must be returned |
|
| 40 | + _YOUR_CODE_HERE_ |
|
| 41 | + } |
|
| 42 | +``` |
|
| 43 | +7. Launch Izenda Reports, go to the Report Designer - Filters tab, select one of the fields assigned to your custom filtering page, select the Equals(PopUp) operator, and click the "..." button. You should see the custom aspx page popup and start being able to select values for your filter. |
|
| ... | ... | \ No newline at end of file |