Project

General

Profile

« Previous | Next » 

Revision 5101

handle repeating "?column?" headers - somewhat naively, but consistent

View differences:

lib/style/skins/first/download.jsp
93 93
			retTable.add(row.toArray(new String[0]));
94 94
			recordCount++;
95 95
		}
96
		//make sure there are no "?column?" headers
97
		for (int i = 0; i < columnHeaders.size(); i++) {
98
			String columnName = (String) columnHeaders.get(i);
99
			if (columnName.equals("?column?")) {
100
				String previousColumn = (String) columnHeaders.get(i-1);
101
				String[] previousParts = previousColumn.split("_");
102
				int previousCount = Integer.parseInt(previousParts[1]);
103
				columnName = previousParts[0]  + "_"+ (previousCount + 1);
104
				columnHeaders.set(i, columnName);
105
			}
106
		}
96 107
		retTable.add(0, columnHeaders.toArray(new String[0]));
97 108
		return retTable;
98 109
	}

Also available in: Unified diff