Get the layout of a bookmark
Get the layout of a bookmark by using the GetLayout method.
Examples
Example 1:
In this example, a chart is created and some values are selected. A bookmark is created and the layout of the bookmark is retrieved.
1. Create a transient chart. The chart contains one dimension (qFieldDefs is ProductName) and one measure (qDef is Sum (OrderTotal)).
The client sends:
The engine returns:
The transient chart is created. Its handle is 2.
2. Select in the dimension ProductName, the values of element numbers 1, 2 and 3. The handle is 2 (handle of the chart).
The client sends:
The engine returns:
The selections are successful.
3. Retrieve the first 10 values of the chart. The handle is 2.
The client sends:
The engine returns:
4. Create the bookmark.
The client sends:
The engine returns:
The bookmark BM01 is created. Its handle is 3.
5. Get the layout of the bookmark. The handle is 3.
The client sends:
The engine returns:
The layout of the bookmark is displayed.
Example 2:
This example shows that the variables present in the app at the creation of the bookmark are listed when getting the layout of the bookmark.
1. Create a first variable, named MyVariable1. The identifier of the variable is Var01.
The client sends:
The engine returns:
The variable Var01 is created. Its handle is 2.
2. Set a value to the variable using the SetNumValue method. The handle of the request is 2 because the variable has 2 as a handle.
The client sends:
The engine returns:
The variable Var01 has 1111 as a value.
3. Create a second variable, named MyVariable2. The identifier of the variable is Var02.
The client sends:
The engine returns:
The variable Var02 is created. Its handle is 3.
4. Set a value to the variable using the SetNumValue method. The handle of the request is 3 because the variable has 3 as a handle.
The client sends:
The engine returns:
The variable Var02 has 2222 as a value.
5. Create a bookmark, using the CreateBookmark method. The identifier of the bookmark is BM01.
The client sends:
The engine returns:
The bookmark BM01 is created and has 4 as a handle.
6. Create a third variable , named MyVariable3. The identifier of the variable is Var03.
The client sends:
The engine returns:
The variable Var03 is created. Its handle is 5.
7. Set a value to the variable using the SetNumValue method. The handle of the request is 5 because the variable has 5 as a handle.
The client sends:
The engine returns:
The variable Var03 has 3333 as a value.
8. Set a new value to the variable Var02. The handle of the request is 3 because the variable has 3 as a handle.
The client sends:
The engine returns:
The variable Var02 has now 4444 as a value.
9. Get the layout of the bookmark. The variables Var01 and Var02 should be returned in the layout. The variable Var03 should not be returned because this variable was not present in the app when the bookmark was created. The variable Var02 should have its old value 2222 because this variable got a new value once the bookmark was already created.
The client sends:
The engine returns:
The layout of the bookmark is returned.