skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Use Reports in Applications
    • System Requirements
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket
    • FAQs
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now
Search all

Class ReportPackager

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
System.Object
ReportPackager
Namespace: Telerik.Reporting
Assembly: Telerik.Reporting.dll

Syntax

public class ReportPackager
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);
}
Dim report = New Report1()
Dim reportPackager = New ReportPackager()
Using targetStream = System.IO.File.Create("PackagedReport2.trdp")
    reportPackager.Package(report, targetStream)
End Using

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);
}
Dim reportPackager = New ReportPackager()
Using targetStream = System.IO.File.Create("PackagedReport3.trdp")
    Dim xmlString = System.IO.File.ReadAllText("Report1.trdx")
    reportPackager.Package(xmlString, targetStream)
End Using

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);
}
Dim reportPackager = New ReportPackager()
Using sourcetStream = System.IO.File.OpenRead("Report1.trdp")
    Dim report = reportPackager.Unpackage(sourcetStream)
End Using

Constructors

ReportPackager()

Initializes a new instance of the ReportPackager class.

Declaration
public ReportPackager()

Methods

Package(String, Stream)

Declaration
public void Package(string xmlDefinition, Stream targetStream)
Parameters
System.String xmlDefinition

System.IO.Stream targetStream

Package(IReportDocument, Stream)

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

Declaration
public void Package(IReportDocument report, Stream targetStream)
Parameters
IReportDocument report

The Report object to package.

System.IO.Stream targetStream

The target stream to write the packaged document.

Remarks

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

Unpackage(Stream)

Unpackages the TRDP document contained by the specified System.IO.Stream.

Declaration
public Report Unpackage(Stream packageStream)
Parameters
System.IO.Stream packageStream

The stream that contains the package to unpackage.

Returns
Report

The Telerik.Reporting object being deserialized.

Remarks

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

UnpackageDocument(Stream)

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

Declaration
public IReportDocument UnpackageDocument(Stream packageStream)
Parameters
System.IO.Stream packageStream

The stream that contains the package to unpackage.

Returns
IReportDocument

The Telerik.Reporting object being deserialized.

Remarks

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

Getting Started
  • Install Now
  • Online Demos
Support Resources
  • Documentation
  • Knowledge Base
  • Videos
  • Reporting Samples Repository
  • Reporting Release History
Community
  • Forums
  • Blogs
  • Reporting Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.