Project

General

Profile

« Previous | Next » 

Revision 4876

include qPrompt and qChoice
need to quote the csv so that commas in the question text do not throw it off

View differences:

download.jsp
86 86
				if (i != pivotCol) {
87 87
					String colName = rs.getMetaData().getColumnName(i);
88 88
					String value = rs.getString(i);
89
					//clean up the value
90
					value = value.replaceAll("\n", " ");
91
					value = value.replaceAll("<html>", " ");
92
					value = value.replaceAll("</html>", " ");
93
					value = value.replaceAll("<head>", " ");
94
					value = value.replaceAll("</head>", " ");
95
					value = value.replaceAll("<body>", " ");
96
					value = value.replaceAll("</body>", " ");
97
					
89 98
					//do we include this column in the pivot?
90 99
					if (pivotAttributes.contains(colName)) {
91 100
						//annotate the column name with the pivot column value if not the id column
......
239 248
	        response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
240 249
	        
241 250
			Writer writer = new OutputStreamWriter(response.getOutputStream());
242
			CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);
251
			//CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);
252
			CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER);
243 253
			try {
244 254
				if (transpose) {
245 255
					List pivotCols = new ArrayList();

Also available in: Unified diff