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
   [Expand]Fundamental Concepts
   [Collapse]Examples
     How to: Bind a Report to an MDB Database (Runtime Sample)
     How to: Bind a Report to Multiple MDB Data Sources (Runtime Sample)
     How to: Bind a Report to a Dataset Populated from an XML File (Runtime Sample)
     How to: Bind a Report to Multiple List Data Sources (Runtime Sample)
     How to: Bind a Report to an MS SQL Server Database
     How to: Calculate a Summary Function
     How to: Create a Calculated Field
     How to: Limit the Data Supplied During Document Editing
     How to: Create a Snap Template (Runtime Sample)
     How to: Sort Data (Runtime Sample)
     How to: Group Data (Runtime Sample)
     How to: Filter Data (Runtime Sample)
     How to: Format Data
     How to: Pass Parameters to a Report
     How to: Pass Parameters to a Report (Runtime Sample)
     How to: Create a Master-Detail Report
     How to: Create a Multi-Column Report
     How to: Create a Side-by-Side Report
     How to: Create a Report with a Chart
     How to: Save, Load, or Export a Report
     How to: Add a Table of Contents to a Report
     How to: Customize the Data Source Wizard
     How to: Programmatically Mark the Data Source as Use for Mail Merge
     How to: Create a Snap Chart Programmatically
  [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

How to: Save, Load, or Export a Report

This tutorial describes how to store a Snap report definition and export a published document to third-party formats.

This tutorial consists of the following sections.

Expanded Save and Restore a Report Layout

The following code illustrates how to save and open a document layout to the native Snap report format.

Note

Loading the mail merge templates with the Entity Framework data source may be unsafe if the data source is contained in a compiled assembly. Handle the SnapControl.BeforeLoadCustomAssembly event to allow loading a custom assembly. Otherwise, the data source throws the CustomAssemblyLoadingProhibitedException exception.

Note

Loading the mail merge templates with the ObjectDataSource data source may be unsafe if the data source is contained in a compiled assembly. Use the SnapControlOptions.DataSourceOptions property and a custom service that implements the IObjectDataSourceValidationService interface to validate an ObjectDataSource contained in the loaded document and prevent the data source from loading.

Expanded Open a Report as a Template

To apply the uniform layout and style settings of a specific document to multiple reports, open this document as a template.

In this mode, the Save command becomes disabled, to prevent opened templates from being overwritten.

To load a report as a template, use the LoadDocumentTemplate method.

The following code illustrates this functionality.

Expanded Save a Document to Third-Party Formats

A Snap report can be exported to the following file formats.
- DOC (Microsoft® Word® 97 - 2003 document).
- DOCX (Office® Open XML document);
- HTML (HyperText Markup Language);
- MHTML / MHT (Web archive, single file);
- PDF (Portable Document Format);
- RTF (Rich Text Format);
- TXT (Plain text);
- ODT (OpenDocument text format);
- XML (Microsoft® Word® XML document);
- Image (BMP, EMF, WMF, GIF, JPEG, PNG or TIFF format).

The following code illustrates how to export a document to PDF or PNG in Snap at runtime.

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