Commit a1c89f90 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature #5603 / Report: final value of report columns (special column name)

parent 399a1b7e
......@@ -1441,11 +1441,17 @@ Store: *RECORD* - R
* *Report*: See `access-column-values`_
* If r=0, all values are empty.
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+========================+==================================================================================================================================================+
| <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form *FormElement*: *{{pId:R}}* |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
+------------------------+-------------------------------------------------------------------------------------------------------------------------+
| Name | Type | Explanation |
+========================+==========+==============================================================================================================+
| <column name> | Form | Name of a column of the primary table (as defined in the current form). Example: *{{pId:R}}* |
+------------------------+----------+--------------------------------------------------------------------------------------------------------------+
| <column name> | Report | Name of a column of a previous fired SQL query. Example: *{{pId:R}}* |
+------------------------+----------+--------------------------------------------------------------------------------------------------------------+
| &<column name> | Report | Name of a column of a previous fired SQL query, typically used by columns with a `special-column-names`_. |
| | (final) | Final value. Example: '{{link:R}}' returns 'p:home&form=Person|s|b:success|t:Edit'. |
| | | Whereas '{{&link:R}}' returns '<span class="btn btn-success"><a href="?home&s=badcaffee1234">Edit</a></span> |
+------------------------+----------+--------------------------------------------------------------------------------------------------------------+
.. _STORE_BEFORE:
......@@ -3375,7 +3381,8 @@ and will be processed after saving the primary record and before any action Form
* *FormElement.value*: By default, the full path of any already uploaded file is shown. To show something different, e.g.
only the filename, define: ::
{{SELECT SUBSTRING_INDEX( '{{pathFileName:R}}', '/', -1) }}
a) {{filenameBase:V}}
b) {{SELECT SUBSTRING_INDEX( '{{pathFileName:R}}', '/', -1) }}
See also `downloadButton`_ to offer a download of an uploaded file.
......@@ -4891,7 +4898,7 @@ Example::
20.sql = SELECT 'a warm welcome'
'some additional', 'columns'
FROM anotherable
FROM another_table
WHERE id>100
20.head = <h3>
......@@ -5025,6 +5032,16 @@ Columns of the upper / outer level result can be accessed via variables in two w
The STORE_RECORD will always be merged with previous content. The Level Keys are unique.
Multiple columns, with the same column name, can't be accessed individually. Only the last column is available.
Retrieving the *final* value of `special-column-names`_ is possible via '{{&<column>:R}}. Example: ::
10.sql = SELECT 'p:home&form=Person|s|b:success|t:Edit' AS _link
10.20.sql = SELECT '{{link:R}}', '{{&link:R}}'
The first column of row `10.20` returns 'p:home&form=Person|s|b:success|t:Edit',the second column returns
'<span class="btn btn-success"><a href="?home&s=badcaffee1234">Edit</a></span>'.
Example STORE_RECORD: ::
10.sql= SELECT p.id AS _pId, p.name FROM Person AS p
......
......@@ -1330,6 +1330,8 @@ const RENDER_MODE_5 = '5';
const RENDER_MODE_6 = '6';
const RENDER_MODE_7 = '7';
const REPORT_TOKEN_FINAL_VALUE = '&';
const WKHTML_OPTION_VIEWPORT = '--viewport-size';
const WKHTML_OPTION_VIEWPORT_VALUE = '1280x1024';
......
......@@ -617,7 +617,7 @@ class Report {
$keyAssoc = OnString::stripFirstCharIf(TOKEN_COLUMN_CTRL, $keys[$ii]);
if ($keyAssoc != '') {
$assoc[$keyAssoc] = $row[$ii];
$assoc[REPORT_TOKEN_FINAL_VALUE . $keyAssoc] = $renderedColumn;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment