An xml file always has the concept of the current node. This is not the case with a sql database - there is no current DbDataReader. A DbDataReader is only generated by the wr:query and the wr:foreach tags. Therefore, all other tags only make sense if they use the var attribute from a query or foreach to identify the DbDataReader they are to be applied to. A tag not identifying a DbDataReader will throw an exception.
A query or foreach tag can reference a var from another query or foreach tag using ${var.item}.. An XPath query can describe a node as well as an element. In this class a query defines a DbDataReader and is only an element.
Also, with xml you can use xpath in each tag performing complex logic in determining what text to return. It is very different for sql. The foreach or query can have complex logic. But the other tags can only return an element from a result set that the foreach/query earlier returned or do a single select.
When using a var (<wr:forEach var="result"/>) that identifies a result set, you can use the following in a tag:
- ${result[1]} - is column element [1] in the row presently on (1-based)
- ${result[2][1]} - is column element [1] in the row + 2 presently on (0-based)
- ${result.NAME} - is the column element named NAME in the row presently on
- ${result[2].NAME} - is the column element named NAME in the row + 2 presently on
- ${result.columnNames[1]} - is the name of column 1 (1-based)
An <if select= ... > will return true if the passed in select returns a DbDataReader with one or more rows. An <if select="select count (*) from customers" notEmpty="true"> will perform two steps. The first step is it will return false if there are no results returned. If results are returned it assumes the select is a count and will do a
return DbDataReader.getInt(1) > 0;
. This does not look at the select statement, it is the notEmpty="true" that puts it in this mode.
Visual Basic (Declaration) | |
---|---|
Public Class AdoDataSourceImpl Inherits DataSourceImplBase Implements WindwardInterfaces.net.windward.api.csharp.IReportDataSource |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As AdoDataSourceImpl |
C# | |
---|---|
public class AdoDataSourceImpl : DataSourceImplBase, WindwardInterfaces.net.windward.api.csharp.IReportDataSource |
Managed Extensions for C++ | |
---|---|
public __gc class AdoDataSourceImpl : public DataSourceImplBase, WindwardInterfaces.net.windward.api.csharp.IReportDataSource |
C++/CLI | |
---|---|
public ref class AdoDataSourceImpl : public DataSourceImplBase, WindwardInterfaces.net.windward.api.csharp.IReportDataSource |
System.Object
net.windward.api.csharp.DataSourceImplBase
net.windward.api.csharp.AdoDataSourceImpl
Requirements
Namespace: net.windward.api.csharp
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP, Windows Vista, Windows Server 2003 family
Assembly: WindwardReportsAPI (in C:\agent\_work\1\s\Engine\DotNetEngine\WindwardReportsAPI\bin\Release\WindwardReportsAPI.dll)