Input Controls -- Changes do not persist

I am trying to change the Input Controls via the REST API.  But I can not get changes to persist. They change for an instant but then revert back to their original values:

How do I get Input Control chages to persist?

Here are the two RESTful calls I am using:

Listing Input Controls

https://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v550/listing-input-control-structure

Setting input controls:

https://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v550/setting-input-control-values

The issue is that I can not set input controls permanently. 

Here is a run through:

FIRST:  List the Input Controls

c:\Users\mverter\Documents>curl -v -u "blahblah:*********" -H"Accept: application/json" "http://blahblahblah/reports/rest_v2/reports/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy/inputControls/"

Result:

{
  "inputControl":
      [{"id":                "Branch_Type_1",
        "description":       null,
        "type":              "singleSelect",
        "uri":  "repo:/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Branch_Type_1",
        "label":             "Branch_Type",
        "mandatory":         false,
        "readOnly":          false,
        "visible":           true,
        "masterDependencies":[],
        "slaveDependencies": [],
        "state":             ... 
                             {"uri": "/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Hierarchy1_1",
                              "id":  "Hierarchy1_1",
                              "value":  null,
                              "error":  null,
                              "options":[ { "selected":false, "label":"Region 1", "value":"Region 1" },
                                          { "selected":true,  "label":"Region 2", "value":"Region 2" },
                                          { "selected":false, "label":"Region 3", "value":"Region 3" },
                                          { "selected":false, "label":"Region 4", "value":"Region 4" },
                                          { "selected":false, "label":"Region 5", "value":"Region 5" }
                                        ]
                                   }
       },
.....

SECOND: Change the Input Controls

curl -v -u "blahblah:*********" -H"Content-Type: application/json" -d "{ Hierarchy1_1: [ 'Region 3' ]}" "http://blahblahblah/reports/rest_v2/reports/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy/inputControls/Hierarchy1_1/"

RESULT:

{
   "inputControl": [ { "id":                 "Hierarchy1_1",
                       "description":        null,
                       "type":               "multiSelect",
                       "uri":                "repo:/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Hierarchy1_1",
                       "label":              "Hierarchy1",
                       "mandatory":          false,
                       "readOnly":           false,
                       "visible":            true,
                       "masterDependencies": [],
                       "slaveDependencies":  [],
                       "state":              { "uri":     "/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Hierarchy1_1",
                                               "id":      "Hierarchy1_1",
                                               "value":   null,
                                               "error":   null,
                                               "options": [ { "selected": false, "label": "Region 1", "value": "Region 1" },
                                                            { "selected": false, "label": "Region 2", "value": "Region 2" },
                                                            { "selected": true,  "label": "Region 3", "value": "Region 3" },
                                                            { "selected": false, "label": "Region 4", "value": "Region 4" },
                                                            { "selected": false, "label": "Region 5", "value": "Region 5" }
                                                          ]
                                             }
                     }
                   ]
}

It looks like Hierarchy1_1 has been set to “Region 3”

THIRD: List the Input Controls again

curl -v -u "blahblah:*********" -H"Content-Type: application/json" -d "{ Hierarchy1_1: [ 'Region 3' ]}" "http://blahblahblah/reports/rest_v2/reports/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy/inputControls/Hierarchy1_1/"
 
curl -v -u "blahblah:*********" -H"Accept: application/json" "http://blahblahblah/reports/rest_v2/reports/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy/inputControls/"

RESULT:

{
   "inputControl": [ { "id":                 "Branch_Type_1",
                       "description":        null,
                       "type":               "singleSelect",
                       "uri":                "repo:/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Branch_Type_1",
                       "label":              "Branch_Type",
                       "mandatory":          false,
                       "readOnly":           false,
                       "visible":            true,
                       "masterDependencies": [],
                       "slaveDependencies":  [],
                       "state":              { ...
                                               "uri":     "/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy_files/Hierarchy1_1",
                                               "id":      "Hierarchy1_1",
                                               "value":   null,
                                               "error":   null,
                                               "options": [ { "selected": false, "label": "Region 1", "value": "Region 1" },
                                                            { "selected": true,  "label": "Region 2", "value": "Region 2" },
                                                            { "selected": false, "label": "Region 3", "value": "Region 3" },
                                                            { "selected": false, "label": "Region 4", "value": "Region 4" },
                                                            { "selected": false, "label": "Region 5", "value": "Region 5" }
                                                          ]
                                             }
                     },

The change did not persist.

mitchell.verter's picture
Joined: Apr 21 2014 - 3:15pm
Last seen: 9 years 2 months ago

0 Answers:

No answers yet
Feedback