[]
Saves a report XML layout to the specified file.
public void SaveReport(FileInfo file)
Type | Name | Description |
---|---|---|
FileInfo | file | FileInfo object representing the file to save the report to. |
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.
The following example demonstrates how to save a report to a file:
FileInfo reportFile = new FileInfo("path/to/your/report.rdlx");
designer.SaveReport(reportFile);
Saves a report XML layout to the specified stream.
[Obsolete("This method has been deprecated. Please use SaveReport(XmlWriter) method instead")]
public void SaveReport(Stream stream)
Type | Name | Description |
---|---|---|
Stream | stream | The stream to save the report to. |
This method has been deprecated. Please use SaveReport(XmlWriter) method instead.
Saves a report XML layout to the specified writer.
public void SaveReport(XmlWriter writer)
Type | Name | Description |
---|---|---|
XmlWriter | writer | The XmlWriter to save the report to. |
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.
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);
}