ActiveReports6 Assembly > DataDynamics.ActiveReports.DataSources Namespace > XMLDataSource Class : RecordsetPattern Property |
Gets or sets a valid XPath pattern used to select the data source nodes to be printed in the report.
The report uses each node selected in the RecordSetPattern to create a detail section.
Note: XSL patterns are case sensitive and must use valid XSL syntax. XSL and XPath documentation can be found on MSDN at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmrefxpathsyntax.asp.
Typical XSL patterns:
Pattern Description
//* All Nodes
//ITEM All ITEM Nodes
/ Root item
/LAYOUT/ITEM/* All child nodes of /LAYOUT/ITEM
//ITEM[@type] All item nodes that contain the type attribute
//ITEM[@id="1"] All item nodes that have an id attribute value of "1"
DataDynamics.ActiveReports.DataSources.XMLDataSource xDS = new DataDynamics.ActiveReports.DataSources.XMLDataSource(); ActiveReport1 rpt = new ActiveReport1(); xDS.ValidateOnParse = true; xDS.FileURL = System.Windows.Forms.Application.StartupPath + " \\customer.xml"; xDS.RecordsetPattern = "//ITEM"; xDS.NodeList = (System.Xml.XmlNodeList)ds.Field("ITEM",true); this.Label1.Text = xDS.CurrentPosition; Console.WriteLine(xDS.Count.ToString()); if (xDS.BOF && xDS.EOF) { return; }
Dim xDS As New DataDynamics.ActiveReports.DataSources.XMLDataSource() Dim rpt As New ActiveReport1() 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
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