ReportPackager
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:
public class ReportPackager
Inheritance: objectReportPackager
Constructors
Initializes a new instance of the ReportPackager class.
public ReportPackager()
Methods
Packages the specified report instance and writes the package to the specified Stream.
public void Package(IReportDocument report, Stream targetStream, ReportDefinitionFormat format = ReportDefinitionFormat.Xml)
The Report object to package.
targetStreamStreamThe target stream to write the packaged document.
formatReportDefinitionFormatThe format of the report definition stored in the package. The default value is Xml. Using Json requires the optional Telerik.Reporting.JsonSerialization assembly.
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.
public void Package(IReportDocument report, string targetFile, ReportDefinitionFormat format = ReportDefinitionFormat.Xml)
The Report object to package.
targetFilestringThe target file to write the packaged document.
formatReportDefinitionFormatThe 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.
public void Package(string definition, Stream targetStream)
The XML or JSON report definition to package.
targetStreamStreamThe target stream to write the packaged document.
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.
public Report Unpackage(Stream packageStream)
The stream that contains the package to unpackage.
Returns:The Report object being deserialized.
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 and TRBP documents contained by the specified Stream.
public IReportDocument UnpackageDocument(Stream packageStream)
The stream that contains the package to unpackage.
Returns:The Report object being deserialized.
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.