This issue can be fixed in Reporting 5.9 and later. Customers are encouraged to upgrade at their earliest convenience. The first part of the article includes steps to fix the issue in Reporting 5.9 and later. The second part of the article includes steps to fix the issue in older versions.
Steps to complete when adding new fields, changing field names, or removing old fields in the data source using Reporting 5.9 and later:
When adding new fields and re-publishing the service:
- Scenario: Run a Preview. It works normally, but the new fields don’t show up under the Field List.
- Edit Query and Run Query Builder. New field will be listed, but it’s unchecked. Check the box and click OK, then Finish. The new field is now listed in the Field List.
When renaming old field names and re-publishing the service:
- Scenario: Run a Preview. An error occurs. The renamed fields don’t show up in the Field List.
- Edit Query and Run Query Builder. The old field names are highlighted in red. Fields with new names are listed, but they're unchecked.
- Uncheck fields in red, check fields with new names. Click OK, then Finish. The preview runs successfully now.
When removing old fields and re-publishing the service:
- Scenario: Run a Preview. An error occurs 'Failed to generate preview'. The removed field is still under the Field List.
- Edit Query and Run Query Builder, the removed field is highlighted in red.
- Uncheck the removed field. Click OK, then Finish.
- Run a Preview. The Field List is updated and correct.
Steps to reset a query in Query Builder so that new fields are present in versions prior to Reporting 5.9:
- Delete a query from Field List.
- Re-add it by clicking Add Query, Data Source Wizard will appear, click Run Query Builder…
- Double-click or drag the required table, it will appear in the Query Builder.
- Check all the fields required for the report.
- Expand Query Properties and click on three dots in Filter. As you are re-adding the Query, you need to build a new Filter to make it work.
- In the Filter Editor click on + and Add Condition.
- In the blue box from the drop-down list select the ‘OBJECTID’. Please note that your layer and ObjectID field names may be different from this.
- In the green box select Is any of.
- In the grey box select Parameter. The colour of the box will change to yellow. Click Create new parameter. Enter the parameter name, i.e. ‘fids’.
- Your Filter Editor should look like the screenshot below. Click OK.
- Expand the Parameters and expand the newly created ‘Fids’ parameter. In the Type select Expression, and in Result Type select Number (32 bit integer). Click on the three dots in the box next to Value and the Expression Editor will appear. Expand Parameters shown in the Fields tab* and double-click on FeatureIds. ‘?FeatureIds’ expression should appear in the window. Click OK.
- Click OK in the Query Builder and then click Finish in the Data Source Wizard.
- The Query and Query Filter should have been re-added successfully.
*Additional steps if there were not any parameters available in the Step 11:
- Open your report and add a new parameter in the Field List by clicking the + button on the Parameters tab.
- The Add Parameter window will appear. Enter a Name and Description. For Type, select Number (32 bit integer). Select Multi-Value if appropriate. Select Allow Null to show any Value by default in Preview mode. The default value is "0".
- To delete ‘0’ from the values, click edit parameter in the Field List. The Edit Parameters window will appear. Click on the ‘0’ value and then delete it by clicking the – button. Then Click OK.
- Go back to Step 11 by adding the newly created parameter in Query Builder.