8bbda2499cb466b07b6f8db6c3bad3149eed8e4d
FAQ/force-update-results-on-report.md
| ... | ... | @@ -7,13 +7,38 @@ How Do I Force a User to Click on 'Update Results' Before Showing Any Data? |
| 7 | 7 | |
| 8 | 8 | ##Answer |
| 9 | 9 | |
| 10 | -There are actually two ways to get this functionality. |
|
| 10 | +There are three ways to get this functionality. Method 1, using filters, is the easiest to implement, but it requires the user to input filter values to work. Method 2 should be employed if you do not wish for the user to input any filter values when hitting Update to execute the report after page load. Method 3 should only be used in versions of Izenda older than 6.9.0.1. |
|
| 11 | 11 | |
| 12 | -###Method 1 |
|
| 12 | +###Method 1 - Filters |
|
| 13 | 13 | |
| 14 | 14 | If you are using filters in the report you want to force this functionality on, you can use the [[Filter tab|http://wiki.izenda.us/Guides/ReportDesign/5.0-Filters-tab#Require-[blank]-Parameters-in-Viewer]] controls to require a user to enter the filter parameters before ever displaying data. |
| 15 | 15 | |
| 16 | -###Method 2 |
|
| 16 | +###Method 2 - Modifying _ReportViewer.js_ |
|
| 17 | + |
|
| 18 | +In the file: |
|
| 19 | + |
|
| 20 | +Resources\FromDLL\Scripts\ReportViewer.js |
|
| 21 | + |
|
| 22 | +There is a function called GotReportViewerConfig. Change this: |
|
| 23 | + |
|
| 24 | +```javascript |
|
| 25 | +if (!initialized) |
|
| 26 | + GetRenderedReportSet(false); |
|
| 27 | +``` |
|
| 28 | + |
|
| 29 | +to this: |
|
| 30 | + |
|
| 31 | +```javascript |
|
| 32 | + if (!initialized) { |
|
| 33 | + initialized = true; |
|
| 34 | + GetReportViewerConfig(); |
|
| 35 | + FirstLoadInit(); |
|
| 36 | + } |
|
| 37 | +``` |
|
| 38 | + |
|
| 39 | +###Method 3 - Modifying _ReportViewer-Body.ascx_ |
|
| 40 | + |
|
| 41 | +**NOTE:** This method should only be used on versions of Izenda older than 6.9.0.1! |
|
| 17 | 42 | |
| 18 | 43 | To ensure a user must click on "Update Results" before showing any report data (regardless if there are filter parameters or not), add the following to the _ReportViewer-Body.ascx_ file in the ``<script>`` tag at the very bottom. This will override a javascript method that normally runs when the page is loaded: |
| 19 | 44 |