The ReportDocument.ExportToStream method is a part of the Crystal Reports library and is used to export a report to a stream in a specified file format. This method is available in C#, and it allows developers to export a report to various file formats such as PDF, Excel, and Word.
Example 1: Exporting a report to PDF
ReportDocument rptDoc = new ReportDocument(); rptDoc.Load("MyReport.rpt");
MemoryStream stream = new MemoryStream(); rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, stream);
Example 2: Exporting a report to Excel
ReportDocument rptDoc = new ReportDocument(); rptDoc.Load("MyReport.rpt");
MemoryStream stream = new MemoryStream(); rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel, stream);
Example 3: Exporting a report to Word
ReportDocument rptDoc = new ReportDocument(); rptDoc.Load("MyReport.rpt");
MemoryStream stream = new MemoryStream(); rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Word, stream);
The package library used in these examples is the Crystal Reports runtime library, which provides an extensive set of reporting tools for developers. This library includes a wide range of features such as data visualization, report design, and exporting capabilities.
C# (CSharp) ReportDocument.ExportToStream - 60 examples found. These are the top rated real world C# (CSharp) examples of ReportDocument.ExportToStream extracted from open source projects. You can rate examples to help us improve the quality of examples.