Database Reference
In-Depth Information
the member combination must contain only level-0 members. Another consideration
is whether the database is a BSo (block storage option) or an ASo database, as BSo
databases require a lock, but ASo databases will throw an exception if you try to execute
a lock. Finally, Essbase gives you no error message if a given cell cannot be written. As
long as you are aware of these items, writing code to update an Essbase database is fairly
easy. For our example, we will continue our code sample after the zoom In operation
from the previous section.
The first thing we will do is reset the grid in order to clear the contents and prepare
the grid for our update. to clear the internal grid, simply call the IEssGridView.setSize
method and set the size of the grid to zero rows by zero columns.
// clear the grid
gv.setSize(0, 0);
next, let us resize the grid to the new required size and fill it with the members we
wish to update.
// resize for the update
gv.setSize(5, 5);
// layout the members to retrieve
gv.setValue(0, 1, "Budget");
gv.setValue(0, 2, "New York");
gv.setValue(0, 3, "Sales");
gv.setValue(1, 1, "Jan");
gv.setValue(1, 2, "Feb");
gv.setValue(1, 3, "Mar");
gv.setValue(1, 4, "Qtr1");
gv.setValue(2, 0, "Cola");
gv.setValue(3, 0, "Diet Cola");
gv.setValue(4, 0, "Colas");
// remove suppress missing for this example
cv.setSuppressMissing(false);
cv.updatePropertyValues();
// now redo the retrieve
cv.performOperation(retrieve);
Let us see what the data looks like before the update.
Budget New York Sales
Jan Feb Mar Qtr1
Cola 640.0 610.0 640.0 1890.0
Diet Cola #Missing #Missing #Missing #Missing
Colas
640.0
610.0
640.0
1890.0
The process of updating the values in the grid is straightforward, as you use the same
IEssGridView.setValue method used to set the members into the grid.
// now add values to the grid for cola and diet cola
// for all three months and the quarter
Search WWH ::




Custom Search