Commit 6dd23900 authored by David Metzler's avatar David Metzler
Browse files

Documentation update for 7.x-4.2 release.

parent f7222968
......@@ -334,7 +334,7 @@ class FrxEditor {
$this->verifyHeaderElements(array('fields'));
$this->setFrxHeader('fields', 'field',
$fieldElements,
array('id', 'link', 'format', 'format-string', 'target', 'rel', 'class', 'add-query', 'calc'),
array('id', 'link', 'format', 'format-string', 'target', 'rel', 'class', 'add-query', 'calc', 'context'),
'default');
}
......
......@@ -318,7 +318,7 @@ class FrxReport {
public function getField($id) {
$field = array_fill_keys(array('default', 'link', 'add-query', 'class', 'rel', 'format', 'format-string', 'target', 'calc'), '');
$field = array_fill_keys(array('default', 'link', 'add-query', 'class', 'rel', 'format', 'format-string', 'target', 'calc', 'context'), '');
if ($this->fields) {
$path = 'frx:field[@id="' . $id . '"]';
$formatters = $this->fields->xpath($path);
......@@ -379,7 +379,7 @@ class FrxReport {
if ($calc) {
if ($context) $context .= ".";
$calc = $this->teng->replace($calc);
if ($calc) $value = $this->teng->replace('{' . $context . '=' . $calc . '}');
if ($calc) $value = $this->teng->replace('{' . $context . '=' . $calc . '}', TRUE);
}
......
......@@ -1049,7 +1049,15 @@ function forena_report_field_form($form, &$form_state, $report_name, $id) {
'#title' => t('calulation'),
'#default_value' => $field['calc'],
'#size' => 100,
'#description' => t('Enter a valid XPath expression to calculate this field with. ')
'#description' => t('Enter a valid XPath expression used to calculate this field. Tokens (e.g. {title} may be used in the calculation.'),
);
$form['field']['context'] = array(
'#type' => 'textfield',
'#title' => t('context'),
'#default_value' => $field['context'],
'#size' => 100,
'#description' => t('Enter the data context used in the calculation. ')
);
$form['update'] = array(
......
This diff is collapsed.
......@@ -17,6 +17,7 @@
<frx:field id="total"
link="reports/sample.user_distribution_simple?state={state}#test"
format="" format-string="" target="" />
<frx:field id="summary_total" calc="sum(*/total)"/>
</frx:fields>
<frx:menu/><frx:cache/></head>
<body>
......@@ -45,6 +46,14 @@
<td>{total}</td>
</tr>
</tbody>
<tfoot>
<!-- The following total is defined by the calculation defined in the above frx:field id="summary_total at the
top of the report -->
<tr>
<td>Total of all States</td>
<td>({summary_total})</td>
</tr>
</tfoot>
</table>
</div>
</body>
......
......@@ -17,8 +17,9 @@
</chapter>
<chapter>
<title>Master Summary with drill down</title>
<subtitle>A graph containing links to another drill down report</subtitle>
<abstract>Graph with a related report with links back to the Report that filters based on state lookup.</abstract>
<subtitle>A graph containing links to another drill down report and embedded calculations.</subtitle>
<abstract>Graph with a related report with links back to the Report that filters based on state lookup. This report also demonstrates the
use of calculation fields embedded in a report. </abstract>
<link>state_summary</link>
</chapter>
<chapter>
......
Markdown is supported
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