- Timestamp:
- Nov 29, 2010, 11:38:52 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy
r1112 r1210 74 74 } 75 75 76 def print = {77 render params78 render "PRINTING"79 }80 81 82 76 def export = { 83 77 … … 94 88 for (studyInstance in studies){ 95 89 downloadFile(studyInstance,false) 96 files.add(new File("web-app/fileuploads/"+studyInstance. title+"_SimpleTox.xls"))90 files.add(new File("web-app/fileuploads/"+studyInstance.code+"_SimpleTox.xls")) 97 91 } 98 92 … … 197 191 if(dl) { 198 192 println "Creation for downloading the file "+studyInstance.title+"_SimpleTox.xls" 199 response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance. title}_SimpleTox.xls\"")193 response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance.code}_SimpleTox.xls\"") 200 194 response.setContentType("application/octet-stream") 201 195 wb.write(response.outputStream) … … 205 199 // Create the file and save into ZIP 206 200 if(!dl){ 207 FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance. title+"_SimpleTox.xls", true)201 FileOutputStream fileOut = new FileOutputStream("web-app/fileuploads/"+studyInstance.code+"_SimpleTox.xls", true) 208 202 wb.write(fileOut) 209 203 fileOut.close() … … 234 228 // writing subject properties 235 229 def writeSubjectProperties(sub,sample,row) { 230 println "----- SUBJECT -----" 236 231 for (u in 0..sample.parentSubject.giveFields().unique().size()-1){ 237 232 TemplateField tf = sample.parentSubject.giveFields().getAt(u) 238 row.createCell((short)9+u).setCellValue("subject-"+tf.name) 233 println tf.name 234 row.createCell((short)9+u).setCellValue(tf.name) 239 235 sample.parentSubject.getFieldValue(tf.name) ? sub.createCell((short)9+u).setCellValue(sample.parentSubject.getFieldValue(tf.name).toString()) : "not define" 240 236 } … … 243 239 // writing samplingEvent properties 244 240 def writeSamplingEventProperties(sub,sample,row){ 241 println "----- SAMPLING EVENT -----" 245 242 for (t in 0..sample.parentEvent.giveFields().unique().size()-1){ 246 243 TemplateField tf =sample.parentEvent.giveFields().getAt(t) 244 println tf.name 247 245 row.createCell((short)9+sample.parentSubject.giveFields().unique().size()+t).setCellValue("samplingEvent-"+tf.name) 248 246 sample.parentEvent.getFieldValue(tf.name) ? sub.createCell((short)9+sample.parentSubject.giveFields().unique().size()+t).setCellValue(sample.parentEvent.getFieldValue(tf.name).toString()) : "not define" … … 257 255 // writing sample properties 258 256 def writeSampleProperties(sub,sample,row){ 257 println "----- SAMPLE -----" 259 258 for (v in 0..sample.giveFields().unique().size()-1){ 260 259 TemplateField tf =sample.giveFields().getAt(v) 260 println tf.name 261 261 row.createCell((short)9+sample.parentSubject.giveFields().unique().size()+v+sample.parentEvent.giveFields().unique().size()).setCellValue("sample-"+tf.name) 262 262 sample.getFieldValue(tf.name) ? sub.createCell((short)9+sample.parentSubject.giveFields().unique().size()+v+sample.parentEvent.giveFields().unique().size()).setCellValue(sample.getFieldValue(tf.name).toString()) : "not define"
Note: See TracChangeset
for help on using the changeset viewer.