Interface

# Dataset

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A component of the `Reports Module</api/printing/reporting/reports_module>` module that provides the data access for the report.

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                             | Parameters                                    | Returns                            | Shared |
|----------------------------------|-----------------------------------------------|------------------------------------|--------|
| `EOF<dataset.eof>`               |                                               | `Boolean</api/data_types/boolean>` |        |
| `Field<dataset.field>`           | idx As `Integer</api/data_types/integer>`     | `Variant</api/data_types/variant>` |        |
|                                  | name As `String</api/data_types/string>`      | `Variant</api/data_types/variant>` |        |
| `NextRecord<dataset.nextrecord>` |                                               | `Boolean</api/data_types/boolean>` |        |
| `Run<dataset.run>`               |                                               |                                    |        |
| `Type<dataset.type>`             | fieldName As `String</api/data_types/string>` | `Integer</api/data_types/integer>` |        |

## Method descriptions

<div id="dataset.eof">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Dataset.EOF

**EOF** As `Boolean</api/data_types/boolean>`

> Specifies whether the end of file has been reached.

<div id="dataset.field">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Dataset.Field

**Field**(idx As `Integer</api/data_types/integer>`) As `Variant</api/data_types/variant>`

> Gets the field by index.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="rst-class">

forsearch

</div>

Dataset.Field

**Field**(name As `String</api/data_types/string>`) As `Variant</api/data_types/variant>`

> Gets the field by name.

<div id="dataset.nextrecord">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Dataset.NextRecord

**NextRecord** As `Boolean</api/data_types/boolean>`

> Advances to the next record.

<div id="dataset.run">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Dataset.Run

**Run**

> Run is the first method to be called when the report is run.

<div id="dataset.type">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Dataset.Type

**Type**(fieldName As `String</api/data_types/string>`) As `Integer</api/data_types/integer>`

> Declares the field types for the data in the <span class="title-ref">Dataset</span>. Returns an `Integer</api/data_types/integer>` that indicates the data type.
>
> The field types are the SQL field types listed in the `Database.TableColumns<database.tablecolumns>` entry. The reporting engine uses this to determine whether the column is numeric and whether the Format function should be applied.

## Notes

The <span class="title-ref">Dataset</span> interface enables you to use any <span class="title-ref">Dataset</span> as the data source for the report. See the example for notes on how to set up the <span class="title-ref">Dataset</span> interface to use a text file as the data source.

To return Pictures for display in a report, you should return the Picture data rather than a Picture object. For example, if you have a Picture in variable p, then your would return the Picture data in the Field method like this:

``` xojo
Return p.GetData(Picture.FormatPNG)
```

Use a type of 14 to identify the Picture as data.

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Desktop |
| **Operating Systems** | All     |

<div class="seealso">

`Reports Module</api/printing/reporting/reports_module>` module; `Report</api/printing/reporting/report>`, `ReportField</api/printing/reporting/reportfield>`, `ReportLabel</api/printing/reporting/reportlabel>`, `ReportLineShape</api/printing/reporting/reportlineshape>`, `ReportOvalShape</api/printing/reporting/reportovalshape>`, `ReportRectangleShape</api/printing/reporting/reportrectangleshape>`, `ReportRoundRectangleShape</api/printing/reporting/reportroundrectangleshape>`. `ReportPicture</api/printing/reporting/reportpicture>` classes; `Displaying Reports</topics/printing/the_report_editor/displaying_reports>` topic

</div>
