Windward Engine API Reference
WindwardReportsDrivers.net.windward.datasource.ado Namespace
See Also  Inheritance Hierarchy Send comments on this topic.

Glossary Item Box

This supplies a sql data source to Windward Reports. This package uses ADO to perform the real work including all selection of nodes using ADO. This is the secondary (after the xml implementation) reference implementation for the net.windward.datasource package.


An xml file always has the concept of the current node. This is not the case with a sql database - there is no current ResultSet. A ResultSet 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 ResultSet they are to be applied to. A tag not identifying a ResultSet 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 ResultSet 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.


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.NAME} - is the column element named NAME in the row 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 ResultSet 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 ResultSet.GetInt(0) > 0;. This does not look at the select statement, it is the notEmpty="true" that puts it in this mode.

Classes

 ClassDescription
ClassAdoDataSource This supplies a data source to Windward Reports using ADO.NET. The DataSourceProvider class is built on the concept of xml nodes. For this class, a node is a DbDataReader returned by a ADO call to DbCommand.ExecuteReader().
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)
The use of result[N] where N is a row number is limited to values of 0...N where N is step-1. result[1] is treated as column 1 of the row presently on, it is only result[0][1] and result[0].NAME that can hit rows other than the row presently on. This functionality requires a result set that can move to previous as well as next. If the ADO driver you use cannot handle a call to previous, you cannot use this functionality. 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.

See Also

© 2019 All Rights Reserved.