Save Grid Layout
/applications/{application}/databases/{database}/layouts
Saves a grid layout for the specified cube. A layout is a saved grid shape associated with a cube. If you create a grid that you would like to use again in the future, you can save it as a Layout. Layouts and reports are included when the cube is copied or moved using migration, export, and Lifecycle Management (LCM) tools.
Request
-
application(required):
Application name.
-
database(required):
Database name.
Response
200 Response
OK
Layout saved successfully.
400 Response
Bad Request
Failed to save layout.
Examples
The following example shows how to save an Essbase grid view as a named layout associated with the cube.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat.
Script with cURL Command
The POST operation uses the specification in postlayout.json to create a saved layout in Sample Basic, named Q1ColaSalesNY.
call properties.bat
curl -X POST "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/layouts?links=none" -H "Accept:application/json" -H "Content-Type:application/json" --data "@./postlayout.json" -u %User%:%Password%Input JSON
The following example shows the contents of the payload in postlayout.json:
{
"header" : {
"name" : "Q1ColaSalesNY",
"user" : "admin",
"databaseDefault" : false,
"userDefault" : false,
"session" : false
},
"spec" : {
"description" : "",
"grid" : {
"alias" : "Default",
"dimensions" : [ {
"name" : "Year",
"page" : 0,
"hidden" : false,
"expanded" : false,
"axis" : "POV",
"position" : 0
}, {
"name" : "Measures",
"page" : 0,
"hidden" : false,
"expanded" : false,
"axis" : "POV",
"position" : 0
}, {
"name" : "Product",
"page" : 0,
"hidden" : false,
"expanded" : false,
"axis" : "POV",
"position" : 0
}, {
"name" : "Market",
"page" : 0,
"hidden" : false,
"expanded" : false,
"axis" : "POV",
"position" : 0
}, {
"name" : "Scenario",
"page" : 0,
"hidden" : false,
"expanded" : false,
"axis" : "POV",
"position" : 0
} ],
"data" : {
"values" : [ [ "", "Actual" ], [ "", "Cola" ], [ "", "New York" ], [ "", "Sales" ], [ "Jan", "1052.0" ], [ "Feb", "645.0" ], [ "Mar", "675.0" ], [ "Qtr1", "2372.0" ] ],
"types" : [ [ "7", "0" ], [ "7", "0" ], [ "7", "0" ], [ "7", "0" ], [ "0", "2" ], [ "0", "2" ], [ "0", "2" ], [ "0", "2" ] ],
"texts" : [ [ null, null ], [ null, null ], [ null, null ], [ null, null ], [ null, null ], [ null, null ], [ null, null ], [ null, null ] ],
"dataFormats" : [ ],
"statuses" : [ [ "0", "536870928" ], [ "0", "268435472" ], [ "0", "402653200" ], [ "0", "134217744" ], [ "16", "2" ], [ "16", "2" ], [ "16", "2" ], [ "134", "1" ] ],
"filters" : [ ],
"enumIds" : [ [ "", "" ], [ "", "" ], [ "", "" ], [ "", "" ], [ "", "" ], [ "", "" ], [ "", "" ], [ "", "" ] ]
}
}
}
}The header information about the layout includes its name, the user who created it, whether it is the default layout for the cube, and whether it is the default layout for this user. Information about the grid is listed within the spec object, including a listing of each dimension of the cube, and the data contained in the layout. The data object includes the values and types of data cells. Data cell types are 0 for text, 2 for doubles, and 7 for empty.