ActiveReports 6 Online Help
LoadLayout Method
Example 

Retrieves a report XML layout (RPX) from a file, stream or resource.
Overload List
OverloadDescription
LoadLayout(Type,String)

This overload has been deprecated. Please use the new LoadLayout(XmlReader) overload.

 
LoadLayout(XmlReader)Retrieves a report XML layout from an XmlReader and loads it into a report object.  
LoadLayout(String)

This overload has been deprecated. Please use the new LoadLayout(XmlReader) overload.

 
LoadLayout(String,ArrayList)

This overload has been deprecated. Please use the new LoadLayout(XmlReader) overload.

 
LoadLayout(Stream)

This overload has been deprecated. Please use the new LoadLayout(XmlReader) overload.

 
LoadLayout(Stream,ArrayList)

This overload has been deprecated. Please use the new LoadLayout(XmlReader) overload.

 
Remarks
If you are loading the RPX into an existing ActiveReports for .NET project, you must first add a new blank report to your project so that any existing reports will not be overwritten by the loaded file. Also, when using this method, any code behind the report is ignored. To embed code in the report, use Scripting.
Example
DataDynamics.ActiveReports.ActiveReport report = new DataDynamics.ActiveReports.ActiveReport();
System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader("\\report.rpx");
report.LoadLayout(xtr);
xtr.Close();

// reading from XML DOM (XmlNode)
using (System.Xml.XmlNodeReader reader = new System.Xml.XmlNodeReader(node))
{
    report.LoadLayout(reader);
}

// reading from stream
using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(inputStream))
{
    report.LoadLayout(reader);
}
           
// reading from string
string layoutContent = "<ActiveReports>...  ...</ActiveReports>";
using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(new System.IO.StringReader(layoutContent)))
{
    report.LoadLayout(reader);
}
Dim report As New DataDynamics.ActiveReports.ActiveReport()
Dim xtr As New System.Xml.XmlTextReader("\report.rpx")
report.LoadLayout(xtr)
xtr.Close()

' reading from XML DOM (XmlNode)
Using reader As New System.Xml.XmlNodeReader(node)
    report.LoadLayout(reader)
End Using

' reading from stream
Using reader As New System.Xml.XmlTextReader(inputStream)
    report.LoadLayout(reader)
End Using

' reading from string
Dim layoutContent As String = "<ActiveReports>...  ...</ActiveReports>"
Using reader As New System.Xml.XmlTextReader(New System.IO.StringReader(layoutContent))
    report.LoadLayout(reader)
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
SaveLayout Method

Concepts

Scripting

Send Feedback