Table des matières

Dashboard Block

Configuring the Output Data

Table type

Data can be presented in 3 forms:

Output column

Example, if the query is:

SELECT
   YEAR(FROM_UNIXTIME(time)) as year,
   count(*) access
FROM
   mdl_log
GROUP BY
year

Then the output columns can be:

year;access

Output column names

Example: Category;Subcategory

Output data format

For a list of reference fields, the format list must contain the same number of formatting expressions separated by semicolons. An empty expression means “no formatting”.

Example: To return two string fields:

%s;%s

Example: For a query defining an attendance rate, you may want to format the division (float) as a number with one digit after the decimal point. The “data output” and “output format” fields, for example, would be expressed like this:

mois;ratio
;%.1f

Learn more about formatted strings

:!: Output with html: It is possible to format an output value by coupling it with html language, so to generate a link on a value displaying a course short name (shortname), you would write the string as follows:

 <a href="/course/view.php?id=%{cid}">%s</a>

Pagination size

Disable security

:!:It is strongly recommended to use result caches for this type of query.

Enable the result cache

The cron allows suitable scheduling of the cache refresh, combined with its TTL value (Time To Live). The cache TTL in minutes can be specified.

Clean the table

Sortable table

Subtotal separation column


Credits

Back to the configuration guide index - Back to the component index - Go to the generic query catalog - Back to the plugin index - Back to the catalog