ActiveReports 6 Online Help
SaveLayout(XmlWriter) Method
Example 

XmlWriter object where the report's layout is saved.
Saves a report's XML layout to the specified XmlWriter.
Syntax
'Declaration
 
Public Overloads Sub SaveLayout( _
   ByVal writer As XmlWriter _
) 
public void SaveLayout( 
   XmlWriter writer
)

Parameters

writer
XmlWriter object where the report's layout is saved.
Remarks

You can use this method to save the report's layout to an XmlWriter object, then store it in a database or a resource file.

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

Example
Report1 ar = new Report1();
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))
{
  report.SaveLayout(writer);
}

// saving to string
System.Text.StringBuilder layoutContent = new System.Text.StringBuilder();
using (System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(layoutContent))
{
  report.SaveLayout(writer);
}
Dim ar As New Report1()
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)
    report.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)
    report.SaveLayout(writer)
End Using
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ActiveReport Class
ActiveReport Members
Overload List

Send Feedback