Merge lp:~sis-ma/dhis2/SISMA-338 into lp:dhis2

Proposed by Leandro Soares
Status: Merged
Merged at revision: 12480
Proposed branch: lp:~sis-ma/dhis2/SISMA-338
Merge into: lp:dhis2
Diff against target: 31 lines (+13/-1)
1 file modified
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java (+13/-1)
To merge this branch: bzr merge lp:~sis-ma/dhis2/SISMA-338
Reviewer Review Type Date Requested Status
DHIS 2 core developers Pending
Review via email: mp+189306@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jens Kaasbøll (jensj) wrote :

This bug has the following consequence in Malawi, where programme coordinators and HMIS officers are used to analysing their data with Excel: they have abandoned the Data set reports and rather open the data entry form and retype the data in Excel. This also prevents them from comparing with data fro other districts, since they are restricted from the data entry form for other districts. Again, it makes them think that they cannot see data from other districts, even of they have reading rights for the whole country.
Pivot tables might be a way out, but many (most?) users are not familiar with these.
Fixing this bug will save them from a lot of extra work.

Revision history for this message
Lars Helge Øverland (larshelge) wrote :

The problem here is likely that they are using custom HTML forms that might
have invalid markup. It is not always easy to parse HTML into a table
structure and produce Excel. It is recommended to use the pivot table app
to produce excel downloads.

On Sat, Nov 29, 2014 at 4:14 PM, Jens Kaasbøll <email address hidden> wrote:

> This bug has the following consequence in Malawi, where programme
> coordinators and HMIS officers are used to analysing their data with Excel:
> they have abandoned the Data set reports and rather open the data entry
> form and retype the data in Excel. This also prevents them from comparing
> with data fro other districts, since they are restricted from the data
> entry form for other districts. Again, it makes them think that they cannot
> see data from other districts, even of they have reading rights for the
> whole country.
> Pivot tables might be a way out, but many (most?) users are not familiar
> with these.
> Fixing this bug will save them from a lot of extra work.
>
> --
> https://code.launchpad.net/~sis-ma/dhis2/SISMA-338/+merge/189306
> Your team DHIS 2 core developers is requested to review the proposed merge
> of lp:~sis-ma/dhis2/SISMA-338 into lp:dhis2.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java'
2--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2013-08-23 16:05:01 +0000
3+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2013-10-04 14:18:36 +0000
4@@ -82,6 +82,7 @@
5 import org.htmlparser.filters.OrFilter;
6 import org.htmlparser.filters.TagNameFilter;
7 import org.htmlparser.nodes.TagNode;
8+import org.htmlparser.tags.Span;
9 import org.htmlparser.tags.TableRow;
10 import org.htmlparser.tags.TableTag;
11 import org.springframework.jdbc.support.rowset.SqlRowSet;
12@@ -572,7 +573,18 @@
13 */
14 public static String getValue( TagNode cell )
15 {
16- return cell.getFirstChild() != null ? cell.getFirstChild().getText().trim().replaceAll( "&nbsp;", EMPTY ) : EMPTY;
17+ String master = new String(EMPTY);
18+ for (Node child : cell.getChildren().toNodeArray())
19+ {
20+ if (child instanceof Span) {
21+ master = master + ((Span)child).getStringText().trim().replaceAll( "&nbsp;", EMPTY );
22+ }
23+ else
24+ {
25+ master = master + child.getText().trim().replaceAll( "&nbsp;", EMPTY );
26+ }
27+ }
28+ return master;
29 }
30
31 // -------------------------------------------------------------------------