ActiveReports 8
LoadXML Method
See Also  Example
GrapeCity.ActiveReports.v8 Assembly > GrapeCity.ActiveReports.Data Namespace > XMLDataSource Class : LoadXML Method

xmlFragment
Specifies a valid XML fragment string to be loaded into the XML document.

Glossary Item Box

Loads an XML fragment from a string.

Syntax

Visual Basic (Declaration) 
Public Sub LoadXML( _
   ByVal xmlFragment As System.String _
) 
C# 
public void LoadXML( 
   System.string xmlFragment
)

Parameters

xmlFragment
Specifies a valid XML fragment string to be loaded into the XML document.

Remarks

The XML is parsed and used as the XML document source.

Example

Paste into the ReportStart event.
C#Copy Code
GrapeCity.ActiveReports.Data.XMLDataSource ds = new GrapeCity.ActiveReports.Data.XMLDataSource();
    ds.ValidateOnParse = true;
    ds.FileURL = null;
    ds.RecordsetPattern = "//Customer";
    ds.LoadXML("<Order><Customer><Name>John Doe</Name><Cardnum>131 131 131 131</Cardnum><Manifest><Item><ID>204</ID><Title>Advanced VB</Title><Quantity>1</Quantity><UnitPrice>$10.75</UnitPrice></Item></Manifest><Receipt><Subtotal>$23.75</Subtotal><Tax>$2.43</Tax></Receipt></Customer></Order>");
Paste into the ReportStart event.
Visual BasicCopy Code
Dim ds As New GrapeCity.ActiveReports.Data.XMLDataSource
    ds.FileURL = Nothing
    ds.ValidateOnParse = True
    ds.RecordsetPattern = "//Customer"
    ds.LoadXML("<Order>" & _
        "<Customer>" & _
        "<Name>John Doe</Name>" & _
        "<Cardnum>131 131 131 131</Cardnum>" & _
        "<Manifest>" & _
        "<Item>" & _
        "<ID>204</ID>" & _
        "<Title>Advanced VB</Title>" & _
        "<Quantity>1</Quantity>" & _
        "<UnitPrice>$10.75</UnitPrice>" & _
        "</Item>" & _
        "</Manifest>" & _
        "<Receipt>" & _
        "<Subtotal>$23.75</Subtotal>" & _
        "<Tax>$2.43</Tax>" & _
        "</Receipt>" & _
        "</Customer>" & _
        "</Order>")

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