diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-03-12 17:57:57 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-03-12 18:16:45 +0100 |
commit | 4178806bb010129f3b13b62825476666fe48ddcd (patch) | |
tree | 26f68a3eb4891945ee06f3630dcf93960de7b3ac /reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java | |
parent | 36caac0e029a3caf50cb27af339efd69008d414e (diff) |
reportbuilder: make "Group on" not-"Each Value" actually work
Change-Id: Id5d73f9aac48ebfb6987e5bf0df37e62f1817bdc
Diffstat (limited to 'reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java')
-rw-r--r-- | reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java b/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java index a22be04503cc..24e1fe10ba52 100644 --- a/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java +++ b/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java @@ -139,6 +139,7 @@ public class SDBCReportDataFactory implements DataSourceFactory private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class); public static final String COMMAND_TYPE = "command-type"; public static final String ESCAPE_PROCESSING = "escape-processing"; + public static final String SORT_EXPRESSIONS = "sort-expressions"; public static final String GROUP_EXPRESSIONS = "group-expressions"; public static final String MASTER_VALUES = "master-values"; public static final String MASTER_COLUMNS = "master-columns"; @@ -229,10 +230,10 @@ public class SDBCReportDataFactory implements DataSourceFactory } } - private String getOrderStatement(final int commandType, final String command, final List groupExpressions) + private String getOrderStatement(final int commandType, final String command, final List sortExpressions) { final StringBuffer order = new StringBuffer(); - final int count = groupExpressions.size(); + final int count = sortExpressions.size(); if (count != 0) { try @@ -244,7 +245,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { for (int i = 0; i < count; i++) { - final Object[] pair = (Object[]) groupExpressions.get(i); + final Object[] pair = (Object[]) sortExpressions.get(i); String expression = (String) pair[0]; if (!expression.startsWith(quote) && columns.hasByName(expression)) @@ -533,7 +534,7 @@ public class SDBCReportDataFactory implements DataSourceFactory WrappedTargetException, NoSuchElementException { - final StringBuffer order = new StringBuffer(getOrderStatement(commandType, command, (ArrayList<?>) parameters.get(GROUP_EXPRESSIONS))); + final StringBuffer order = new StringBuffer(getOrderStatement(commandType, command, (ArrayList<?>) parameters.get(SORT_EXPRESSIONS))); if (order.length() > 0 && commandType != CommandType.TABLE) { String statement = command; |