Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Collapse]Snap
   [Expand]Product Information
   [Expand]Getting Started
   [Collapse]Fundamental Concepts
    [Expand]Graphical User Interface
     Supported Formats
    [Collapse]Developer Guidelines
      Application Programming Interface
      Snap Commands
      Snap List and Document Template
      Snap Fields
      Snap Document Events
      Globalization (Units of Measurement)
    [Expand]Data Acquisition
    [Expand]Data Shaping
   [Expand]Examples
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Application Programming Interface

This topic provides a software developer's perspective on the architecture of Snap, including its object model overview.

The topic includes the following sections.

Expanded Snap Application Programming Interface

The reporting functionality of SnapControl is built on its ancestor RichEditControl, which includes a familiar graphical user interface found in word-processing software.

To create documents in code, Snap provides an application programming interface (API) that includes the following main elements.

  1. SnapDocument provides methods, properties and events to manage a document's content, data sources and parameters.

  2. SnapList is an area of a Snap document, which uses templates to define the layout and formatting of data. These templates have a basic tabular structure that follows that of the Table class. In the created document, these templates are serialized as field codes that use a special markup.

    To provide data shaping capabilities, the Snap list exposes the following properties:
    - SnapList.Filters;
    - SnapList.Groups;
    - SnapList.Sorting.

  3. The following elements provide the functionality required to present data in Snap documents:
    - SnapBarCode;
    - SnapCheckBox;
    - SnapHyperlink;
    - SnapImage;
    - SnapSparkline;
    - SnapText.

A code example illustrating the programmatic generation of a document's layout using the above API elements is available online at How to generate a document layout via the Snap application programming interface (API).

For more information, refer to Snap List and Document Template.

Expanded Runtime Customization

Each Snap field in a document corresponds to a specific SnapEntity that is returned by the ISnapFieldOwner.ParseField method. Any modification of an entity at runtime must be wrapped in the SnapEntity.BeginUpdate and SnapEntity.EndUpdate method calls.

After calling the SnapEntity.BeginUpdate method, the SnapEntity.Active property becomes enabled until the SnapEntity.EndUpdate method is called. A document can only contain one active entity at one time.

The following requirements apply to the proper customization of a Snap entity at runtime.

Do not call the SnapEntity.EndUpdate method for a parent entity until there is no active nested entity left within it.

Nested Fields

If a document contains multiple entities that are nested inside each other (e.g., in case of a master-detail report), only the outermost (parent) field in this document is active.

The parent field's data is contained in one or more SnapDocument objects assigned to the field templates (e.g., SnapList.RowTemplate, SnapListGroupInfo.Header, or SnapListGroupInfo.Footer).

To modify the content of a nested field within a parent field's document, do the following.

  1. Obtain the nested field from a corresponding SnapDocument.

  2. Parse the field by calling the ISnapFieldOwner.ParseField method that returns the appropriate SnapEntity.

  3. Call the SnapEntity.BeginUpdate method of the returned entity.

  4. After making the required changes, make sure to call the SnapEntity.EndUpdate method for the nested entity.

  5. Call the SnapEntity.EndUpdate method for the parent entity.

Expanded See Also

How would you rate this topic?​​​​​​​