Jump to content
We've recently updated our Privacy Statement, available here ×

Input Controls -- Changes do not persist


mitchell.verter

Recommended Posts

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:UsersmverterDocuments>curl -v -u "blahblah:*********" -H"Accept: application/json" "http://blahblahblah/reports/rest_v2/reports/Reports/Stock/Views/Sales_Performance_Trend_by_Hierarchy/inputControls/"[/code]

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" }                                        ]                                   }       },.....[/code]

 

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/"[/code]

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" }                                                          ]                                             }                     }                   ]}[/code]

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/"[/code]

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" }                                                          ]                                             }                     },[/code]

The change did not persist.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...