ActiveReports Developer 7
LoadLayout(XmlReader) Method
See Also  Example
GrapeCity.ActiveReports.v7 Assembly > GrapeCity.ActiveReports Namespace > SectionReport Class > LoadLayout Method : LoadLayout(XmlReader) Method

reader
XmlReader object from which to retrieve the report's layout.

Glossary Item Box

Retrieves a report XML layout from an XmlReader and loads it into a report object.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub LoadLayout( _
   ByVal reader As System.Xml.XmlReader _
) 
C# 
public void LoadLayout( 
   System.Xml.XmlReader reader
)

Parameters

reader
XmlReader object from which to retrieve the report's layout.

Remarks

This method can be executed for any existing report class (code type). However, in such cases, all the layout related information defined in existing report class is cleared and gets updated with the loaded RPX file content. Due to this reason, any code (example: Me.textBox1.Text = "ABC") that directly tries to access a control on a report and is defined in the existing report class is ignored. For event related code implementations, it is possible to embed the code in RPX file. In this case, please use Scripting.

Example

C#Copy Code
GrapeCity.ActiveReports.ActiveReport report = new GrapeCity.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);
}
Visual BasicCopy Code
Dim report As New GrapeCity.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

See Also