This example illustrates the Snap application programming interface by generating a document from scratch completely in code.
The Snap API used for document generation is mostly similar to that of the RichEditControl - the ancestor of the SnapControl. The Snap's most notable contribution to this API is the SnapList that is used to inject dynamic data elements into a document.
To generate a data-aware Snap document, do the following:
1) Create a Snap application and connect it to a data source.
2) Add a SnapList to the SnapDocument.
3) To generate the SnapList layout, define the ListHeader, ListFooter, and RowTemplate.
4) Inject data fields into the document (e.g., by using SnapText to display text data).
5) Format the document content (see the FormatList method implementation in the Form1.cs file of the sample solution).
6) If required, apply grouping, sorting, and/or filtering to the SnapList content.
A SnapEntity is open to customization only after calling its BeginUpdate method and not after the EndUpdate method is called to apply the new settings (see the GenerateLayout method in the Form1.cs file of the sample solution).