Define a view datasource
Define a view datasource
Technologies > User Interface Add-Ins > Parts for Reports > Report with Grid Panel
The
dataSource
element
defines what data can be displayed in the view, or changed by the user.
Before the view is displayed to the user, Web Central or Smart Client find and load
the database record (or records) specified in the
dataSource
..
For example, the following AXVW fragment will load records from the project table, four field values for each record:
<dataSource id="reportGridBaseline_ds">
<table name="project" role="main"/>
<field table="project" name="project_id"/>
<field table="project" name="status"/>
<field table="project" name="date_start"/>
<field table="project" name="date_end"/>
</dataSource>
If this
dataSource
is defined within a
form
table-group, it will only load a single record. If the data source is defined
within a report table-group,
it will load multiple records. Exactly how many records are loaded is
defined by the view restriction
.
Define a datasource restriction
Sort Order
Typically, the sort order for a grid report is specified within the grid panel element,
Grid Control 2.0
Note that the sort field can also be specified in the data source. However, in this case, the sort order is permanent and the user will not be able to change the sort order using grid controls.
Distinct Attribute
The
distinct
attribute of the
dataSource
may optionally be set to
true
. In this case, all fields in the SELECT clause should also be explicitly specified in the Sort Order.
<dataSource id="reportGridBaseline_ds" distinct="true">