ActiveReports 18 .NET Edition
MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports.Data Namespace / XMLDataSource Class / Field Method
Example

In This Topic
    Field Method (XMLDataSource)
    In This Topic
    Returns the XML node or nodelist using the specified XPath pattern relative to the current node (record).
    Overload List
    OverloadDescription
    Returns the XML node or nodelist using the specified XPath pattern relative to the current node.  
    Returns the XML node or nodelist using the specified XPath pattern relative to the current node. The isOutputformatNull flag specifies whether to use the text of the current node.  
    Example
    Paste into the Detail Format event.
    GrapeCity.ActiveReports.Data.XMLDataSource xDS = new GrapeCity.ActiveReports.Data.XMLDataSource();
    SectionReport1 rpt = new SectionReport1();
    
        xDS.ValidateOnParse = true;
        xDS.FileURL = System.Windows.Forms.Application.StartupPath + " \\customer.xml";
        xDS.RecordsetPattern = "//ITEM";
        xDS.NodeList = (System.Xml.XmlNodeList)xDS.Field("ITEM",true);
        this.Label1.Text = xDS.CurrentPosition;
        Console.WriteLine(xDS.Count.ToString());
    
        if (xDS.BOF && xDS.EOF)
        {
            return;
        }
    Paste into the Detail Format event.
    Dim xDS As New GrapeCity.ActiveReports.Data.XMLDataSource()
    Dim rpt As New SectionReport1()
    
        xDS.ValidateOnParse = True
        xDS.FileURL = System.Windows.Forms.Application.StartupPath + " \\customer.xml"
        xDS.RecordsetPattern = "//ITEM"
        xDS.NodeList = xDS.Field("ITEM", True)
        Me.Label1.Text = xDS.CurrentPosition
        Console.WriteLine(xDS.Count.ToString())
    
        If xDS.BOF & xDS.EOF Then
            Exit Sub
        End If
    See Also