ActiveReports 8
SaveLayout Method
Example 

Saves a report's XML layout to a stream or file.
Overload List
OverloadDescription
SaveLayout(Stream)

This overload has been deprecated. Please use the new SaveLayout(XmlWriter) overload.

 
SaveLayout(Stream,RpxFormat)Saves a report's XML layout to the specified stream in the specified format.  
SaveLayout(XmlWriter)Saves a report's XML layout to the specified XmlWriter.  
SaveLayout(String)

This overload has been deprecated. Please use the new SaveLayout(XmlWriter) overload.

 
SaveLayout(String,RpxFormat)Saves a report's XML layout to the specified file in the specified format.  
Remarks

The SaveLayout(String) method uses the UTF-8 encoding, and the SaveLayout(Stream) method uses the UTF-16 encoding  for saving.

When using this method, any code behind the report is ignored. To embed code in the report, use Scripting.

Example
SectionReport1 ar = new SectionReport1();
System.Xml.XmlTextWriter xtw = new System.Xml.XmlTextWriter("\\report.rpx", null);
ar.SaveLayout(xtw);
xtw.Close();

// saving to stream
System.IO.MemoryStream memory_stream = new System.IO.MemoryStream();
using (System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(memory_stream))
{
    ar.SaveLayout(writer);
}
 
// saving to string
System.Text.StringBuilder layoutContent = new System.Text.StringBuilder();
using (System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(layoutContent))
{
    ar.SaveLayout(writer);
}
Dim ar As New SectionReport1()
Dim xtw As New System.Xml.XmlTextWriter("\report.rpx", Nothing)
ar.SaveLayout(xtw)
xtw.Close()

' saving to stream
Dim memory_stream As New System.IO.MemoryStream
Using writer As System.Xml.XmlWriter = System.Xml.XmlWriter.Create(memory_stream)
    ar.SaveLayout(writer)
End Using

' saving to string
Dim layoutContent As New System.Text.StringBuilder()
Using writer As System.Xml.XmlWriter = System.Xml.XmlWriter.Create(layoutContent)
    ar.SaveLayout(writer)
End Using
See Also

Reference

SectionReport Class
SectionReport Members
LoadLayout Method

Concepts

Scripting

Support Forum