ActiveReports 12 Server Designer User Guide
Add a Dataset
ActiveReports 12 Server Designer User Guide > Get Started with ClickOnce End User Designer > Connect to Data > Add a Dataset

In a Page or RDL report, once you connect to a data source, you add a data set to get a list of fields to use in the report.

  1. In the Report Explorer, right-click the data source node (DataSource1 by default) and select Add Data Set.
    Or from the Add button, select Data Set....
  2. In the DataSet dialog that appears, select the General page and enter the name of the dataset. This name appears in the Report Explorer as a child of the data source node, so it is useful to give it a meaningful name.
  3. On the Query page of this dialog, select a Command Type from the dropdown list.
    • Text: Enter a SQL query or XML path in the Query box.
      See Visual Query Designer in the ActiveReports User Guide for more on using the interactive query designer.
    • StoredProcedure: Enter the name of the stored procedure in the Query box.
    • TableDirect: Enter the name of the table in the Query box.
  4. Click the Validate DataSet icon  at the top right to validate the query.
     
  5. The fields automatically appear in the Fields page in the DataSet dialog.
    Note: For XML data, you must manually enter fields on the Fields page using valid XPath expressions.
  6. You can also set parameters, filters, and data options on the other pages of the dialog.
  7. Click the OK button to close the dialog. Your data set and fields appear as nodes in the Report Explorer.
Note: If you are using an XML data source provider, you provide an XML path on the Query page and generate fields using XPath expressions on the Fields page of the DataSet dialog. See the following example for details.

Query and Field Settings for XML Data

The XML provider supports the use of XPath 1.0 in building queries and selecting Fields. Here is an example of how to set the query string and fields with an XMLData connection string.

Connection String

Example of an XmlData connection string.

XmlData=<people>
  <person>
    <name>
      <given>John</given>
      <family>Doe</family>
    </name>
  </person>
  <person>
    <name>
      <given>Jane</given>
      <family>Smith</family>
    </name>
  </person>
</people>;

Query String

Example of a query for the XmlData example above.

/people/person/name

Fields

Once the query is set, add two fields to the Fields collection with the following name and value pairs:

Name: Given
Value: given               

Name: Family
Value: family