=== modified file 'src/docbkx/en/dhis2_user_man_creating_reporting.xml' --- src/docbkx/en/dhis2_user_man_creating_reporting.xml 2011-06-23 12:34:45 +0000 +++ src/docbkx/en/dhis2_user_man_creating_reporting.xml 2011-07-08 10:31:38 +0000 @@ -865,6 +865,38 @@ The same expressions can be used for example when having indicator names along the category axis of a chart.
+ Adding horizontal totals + By using the expression editor, it is possible to add a column to the table with totals for each row. In the following example, we will make a table with three months as columns as well as a column with the totals for the three months. + We start by dragging a text label into the table header and changing its text to "Total", and dragging a text field into the details row. + + Add a text field + + + + + + + As was discussed in the section on "Text field", we have to change the properties of the new text field so that it can display numbers. To do this, change the "Expressions Class" in the properties panel to "java.lang.Double". + + Change text field type + + + + + + + Right click the text field and choose "Edit Expression". This will bring up the "Expressions editor". As the expression, we want to sum up all the columns. In this case we have three value expressions we want to sum up: "September", "October 2010", "November 2010". The name of these fields will vary depending on the crosstab dimension you have chosen in the report table. In our case, the expression we make is "$f{September}+$f{October 2010}+$f{November 2010}": + + Edit the expression + + + + + + + Each row of the table have a totals column to the right. +
+
Groups of tables There are cases when it can be useful to have several tables in one report. This can be done using Report groups. Using this functionality, one can for example create a report one table for each indicator, or one table of each organisation unit. In the following, we will go through the steps needed to make a report with three indicators, each represented in one table. It is important that the report table does not crosstab on indicators when we want to make groups of tables based on indicators. In our example, the .jrxml file downloaded from DHIS 2 will by default have one column for organisation unit and on for indicators (assuming we have chosen periods as the only crosstab dimension). We start by removing the indicator column, since this in not needed in our case, and realign the other fields to fit the report.