Feeding the report data to an XML text writer

You can use an XMLTextWriter to directly create the XML. This method does not use the data model approach.

The Genero Report Engine expects the data to be shipped to its XML writer. The interface allows arbitrarily-sized XML documents to be shipped with a very low memory consumption to the engine. This is achieved using a call interface providing the three basic methods: WriteStartElement, WriteEndElement, and WriteElementString.

As an example, consider the following XML document:
<?xml version ="1.0" encoding="UTF-8"?>
<List>
  <Item>Item 1</Item>
  <Item>Item 2</Item>
</List>
This document is send to the content handler in a simplified manner as follows:
writer.WriteStartDocument(); 
writer.WriteStartElement("List");
writer.WriteElementString("Item", "Item 1");
writer.WriteElementString("Item", "Item 2");
writer.WriteEndElement();
writer.WriteEndDocument();         

This low-level interface is universally usable to serialize data to the engine but typically it is more practical to use a more high-level interface such as object serialization.

If you use this method, you cannot use xsd.exe to create the data schema file, a necessary input for the report design tools. In this situation, you must create the data schema by hand.