dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22947
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11156: Error when to run aggregate tabular report (DONE)
------------------------------------------------------------
revno: 11156
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-06-06 15:12:06 +0700
message:
Error when to run aggregate tabular report (DONE)
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-06-06 05:48:27 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-06-06 08:12:06 +0000
@@ -589,8 +589,6 @@
grid.setSubtitle( subTitle );
}
}
-
-
// ---------------------------------------------------------------------
// Get SQL and build grid
@@ -1191,15 +1189,15 @@
sql += filterSQL + "LIMIT 1 ) ";
}
- sql += "as \"" + periodName + "\" ,";
+ sql += " as \"" + periodName + "\" ,";
}
// -- end period
sql = sql.substring( 0, sql.length() - 1 ) + " ";
- sql += " ) ";
+ sql += " ) ) ";
sql += " UNION ";
}
- sql = sql.substring( 0, sql.length() - 6 );
+ sql = sql.substring( 0, sql.length() - 10 );
sql += " ORDER BY orgunit asc ";
if ( limit != null )
{
@@ -1290,13 +1288,14 @@
}
}
- sql = sql.substring( 0, sql.length() - 6 ) + " ";
+ sql = sql.substring( 0, sql.length() - 6 ) + " ) ";
+
sql += " ORDER BY orgunit asc ";
if ( limit != null )
{
sql += "LIMIT " + limit;
}
-
+
return sql;
}
@@ -1370,10 +1369,10 @@
}
sql += " psi_1.executiondate >= '" + startDate + "' AND ";
sql += " psi_1.executiondate <= '" + endDate + "' ";
- sql += filterSQL + " LIMIT 1 ) ";
+ sql += filterSQL + " LIMIT 1 ";
}
- sql += " as " + aggregateType;
+ sql += " ) as " + aggregateType;
sql += ") ";
sql += " UNION ALL ";
@@ -1381,6 +1380,9 @@
}
sql = sql.substring( 0, sql.length() - 10 );
+
+ if( periods.size() > 1 )
+
if ( limit != null )
{
sql += " LIMIT " + limit;
@@ -2246,7 +2248,8 @@
for ( int i = 1; i <= cols; i++ )
{
// meta column
- if ( rs.getMetaData().getColumnType( i ) == Types.VARCHAR )
+ if ( rs.getMetaData().getColumnType( i ) == Types.VARCHAR
+ || rs.getMetaData().getColumnType( i ) == Types.OTHER )
{
grid.addValue( rs.getObject( i ) );
}