New to Telerik ReportingStart a free 30-day trial

Packages and unpackages report documents in TRDP format. This is a zipped file format for representing report documents that stores the report definitions as either XML or JSON. Starting with Telerik Reporting Q2 2016, the TRDP has become the default target file format for Telerik Report Designer and Telerik Report Server.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

C#
public class ReportPackager

Inheritance: objectReportPackager

Constructors

Initializes a new instance of the ReportPackager class.

C#
public ReportPackager()

Methods

Packages the specified report instance and writes the package to the specified Stream.

C#
public void Package(IReportDocument report, Stream targetStream, ReportDefinitionFormat format = ReportDefinitionFormat.Xml)
Parameters:reportIReportDocument

The Report object to package.

targetStreamStream

The target stream to write the packaged document.

formatReportDefinitionFormat

The format of the report definition stored in the package. The default value is Xml. Using Json requires the optional Telerik.Reporting.JsonSerialization assembly.

Remarks:

Use the targetStream parameter to specify an object that derives from the Stream class, which is designed to write to streams. Classes that derive from the Stream class include: BufferedStream, FileStream, MemoryStream, etc.

Packages the specified report instance and writes the package to the specified target file.

C#
public void Package(IReportDocument report, string targetFile, ReportDefinitionFormat format = ReportDefinitionFormat.Xml)
Parameters:reportIReportDocument

The Report object to package.

targetFilestring

The target file to write the packaged document.

formatReportDefinitionFormat

The format of the report definition stored in the package. The default value is Xml. Using Json requires the optional Telerik.Reporting.JsonSerialization assembly.

Packages the specified XML or JSON report definition and writes the package to the specified Stream.

C#
public void Package(string definition, Stream targetStream)
Parameters:definitionstring

The XML or JSON report definition to package.

targetStreamStream

The target stream to write the packaged document.

Remarks:

The report definition should be created with Telerik Report Designer (TRDX/TRDJ), or serialized with either the ReportXmlSerializer, or the Telerik.Reporting.JsonSerialization.ReportJsonSerializer. Packaging a JSON report definition requires the optional Telerik.Reporting.JsonSerialization assembly.

Unpackages the TRDP document contained by the specified Stream.

C#
public Report Unpackage(Stream packageStream)
Parameters:packageStreamStream

The stream that contains the package to unpackage.

Returns:

Report

The Report object being deserialized.

Remarks:

Use the packageStream parameter to specify an object that derives from the Stream class, which is designed to write to streams. Classes that derive from the Stream class include: BufferedStream, FileStream, MemoryStream, etc.

Unpackages the TRDP document located at the specified location.

C#
public Report Unpackage(string targetFile)
Parameters:targetFilestring

The location of the TRDP document to unpackage.

Returns:

Report

The Report object being deserialized.

Unpackages the TRDP and TRBP documents contained by the specified Stream.

C#
public IReportDocument UnpackageDocument(Stream packageStream)
Parameters:packageStreamStream

The stream that contains the package to unpackage.

Returns:

IReportDocument

The Report object being deserialized.

Remarks:

Use the packageStream parameter to specify an object that derives from the Stream class, which is designed to write to streams. Classes that derive from the Stream class include: BufferedStream, FileStream, MemoryStream, etc.