[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Design.Designer.SaveReport

SaveReport Method

SaveReport(FileInfo)

Saves a report XML layout to the specified file.

Declaration
public void SaveReport(FileInfo file)
Parameters
Type Name Description
FileInfo file

FileInfo object representing the file to save the report to.

Remarks

This method first ensures that any pending changes to the report are committed by flushing the designer loader. It then delegates the save operation to the implementation layer, which handles the specifics of saving the report to the file system. The file path is obtained from the FileInfo object.

Examples

The following example demonstrates how to save a report to a file:

FileInfo reportFile = new FileInfo("path/to/your/report.rdlx");
designer.SaveReport(reportFile);

SaveReport(Stream)

Saves a report XML layout to the specified stream.

Declaration
[Obsolete("This method has been deprecated. Please use SaveReport(XmlWriter) method instead")]
public void SaveReport(Stream stream)
Parameters
Type Name Description
Stream stream

The stream to save the report to.

Remarks

This method has been deprecated. Please use SaveReport(XmlWriter) method instead.

SaveReport(XmlWriter)

Saves a report XML layout to the specified writer.

Declaration
public void SaveReport(XmlWriter writer)
Parameters
Type Name Description
XmlWriter writer

The XmlWriter to save the report to.

Remarks

This method allows saving the report's XML layout directly to an XmlWriter, providing flexibility in how and where the report is saved. It checks for a null XmlWriter to avoid exceptions and delegates the save operation to the implementation layer, which handles the serialization of the report layout.

Examples

The following example demonstrates how to use an XmlWriter to save a report:

using (var stream = new FileStream("path/to/your/report.rdlx", FileMode.Create))
using (var writer = XmlWriter.Create(stream))
{
	designer.SaveReport(writer);
}