Progress® Telerik® Reporting R3 2017

ReportPackager Class

Packages and unpackages report documents in TRDP format. This is a zipped, XML-based file format for representing report documents. Starting with Telerik Reporting Q2 2016, the TRDP have become the default target file format for Telerik Report Designer and Telerik Report Server.

Inheritance Hierarchy

SystemObject
  Telerik.ReportingReportPackager

Namespace:  Telerik.Reporting
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

public class ReportPackager

The ReportPackager type exposes the following members.

Constructors

  NameDescription
Public methodReportPackager
Initializes a new instance of the ReportPackager class.
Top

Methods

  NameDescription
Public methodPackage(String, Stream)
Public methodPackage(IReportDocument, Stream)
Packages the specified report instance and writes the package to the specified Stream.
Public methodUnpackage
Unpackages the TRDP document contained by the specified Stream.
Public methodUnpackageDocument
Unpackages the TRDP and TRBP documents contained by the specified Stream.
Top

Examples

The following example demonstrates how to package a report definition instance:
var report = new Report1();
var reportPackager = new ReportPackager();
using (var targetStream = System.IO.File.Create("PackageReport1.trdp"))
{
    reportPackager.Package(report, targetStream);
}
The following example demonstrates how to package a XML report definition:
var reportPackager = new ReportPackager();
using (var targetStream = System.IO.File.Create("PackagedReport2.trdp"))
{
    var xmlString = System.IO.File.ReadAllText("Report1.trdx");
    reportPackager.Package(xmlString, targetStream);
}
The following example demonstrates how to unpackage a .TRDP report definition:
var reportPackager = new ReportPackager();
using (var sourceStream = System.IO.File.OpenRead("Report1.trdp"))
{
    var report = (Report)reportPackager.UnpackageDocument(sourceStream);
}

See Also