5. Save a View

You have already learned how to modify a table view (advanced features such as grouping of rows and ungrouping a nested table will be discussed later). Some views, such as filtering out albums that are out of stock, are required frequently, and their repetitive definition is inefficient. Therefore it is advisable to save frequently used views into the View section.
First create a filter displaying only rows where the value in the Stock column is equal to 0.
You can then save the view in several ways:
Right-click anywhere in the table whose view you wish to save. In the context menu, select the Save View… option.
In the dialog that pops up, type out_of_stock in the View name field and press OK.
This creates an out_of_stock item in the View document section, containing the defined view. Whenever the contents of the cd_list table changes, the created view will be automatically updated so that you can always quickly see which albums have run out of stock.
Alternatively, you can save a view by simply dragging the cd_list item with the mouse from the Data section to the View section. You can also use the copy (Ctrl+C) and paste (Ctrl+V) operations instead of mouse drag and drop. You can then change the name of the saved view through the corresponding item in the View Type document section.
Note: an item from the View section (just like an item from any other document section) can be displayed in a separate window by double-clicking its title in the left pane of the document main window. This way you can display a source table and its view simultaneously.

View Cancellation

You can quickly cancel all changes made to a table view by the Reset View option in the context menu. To delete a view stored in the View document section, activate the respective item in the left pane and press the Delete key or the button in the tool bar.

Saving the Instant State of a View

Sometimes, you will need to save the instant state of a view so that it is available even after the view has changed. This is done through the Save Instant State option in the context menu. When you select it, a dialog appears, where you can type the name under which the instant state will be saved. The instant state is saved as a new item in the Data document section. If you check the save into new document option in the dialog, a new document is created, and the data item is saved to this new document.
If you wish to save the instant state of a view stored in the View document section, all you need to do is drag and drop the required item from the View section in the left pane to the Data section (of the same document or of another document).

Further Information

The following chapters of the Reference Guide contain detailed information on the discussed topics: