- Timestamp:
- Nov 1, 2010, 4:38:36 PM (12 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy
r1000 r1035 88 88 89 89 HSSFWorkbook wb = new HSSFWorkbook() 90 FileOutputStream fileOut = new FileOutputStream(studyInstance.title+"_SimpleTox.xls")90 //FileOutputStream fileOut = new FileOutputStream(studyInstance.title+"_SimpleTox.xls") 91 91 // HSSFCellStyle style = wb.createCellStyle() 92 92 // style.setFillForegroundColor((short) HSSFColor.RED.index) … … 126 126 sub.createCell((short)8).setCellValue(studyInstance.samples.getAt(s-1).parentSubject.species.name) 127 127 128 // adding the subject domain + template properties 128 129 for (u in 0..studyInstance.samples.getAt(s-1).parentSubject.giveFields().unique().size()-1){ 129 row.createCell((short)9+u).setCellValue(studyInstance.samples.getAt(s-1).parentSubject.giveFields().getAt(u).toString())130 // println "VALUE "+studyInstance.samples.getAt(s-1).parentSubject.getFieldValue(u.name)131 130 TemplateField tf = studyInstance.samples.getAt(s-1).parentSubject.giveFields().getAt(u) 132 // println tf.name133 // println studyInstance.samples.getAt(s-1).parentSubject.giveFields().getAt(u)134 131 row.createCell((short)9+u).setCellValue(tf.name) 135 132 studyInstance.samples.getAt(s-1).parentSubject.getFieldValue(tf.name) ? sub.createCell((short)9+u).setCellValue(studyInstance.samples.getAt(s-1).parentSubject.getFieldValue(tf.name).toString()) : "not define" 136 133 } 137 134 135 // adding the samplingEvent domain + template properties 136 for (t in 0..studyInstance.samples.getAt(s-1).parentEvent.giveFields().unique().size()-1){ 137 TemplateField tf = studyInstance.samples.getAt(s-1).parentEvent.giveFields().getAt(t) 138 row.createCell((short)9+studyInstance.samples.getAt(s-1).parentSubject.giveFields().unique().size()+t).setCellValue(tf.name) 139 studyInstance.samples.getAt(s-1).parentEvent.getFieldValue(tf.name) ? sub.createCell((short)9+studyInstance.samples.getAt(s-1).parentSubject.giveFields().unique().size()+t).setCellValue(studyInstance.samples.getAt(s-1).parentEvent.getFieldValue(tf.name).toString()) : "not define" 140 } 141 142 // adding samples domain + template properties 143 TemplateField sf = studyInstance.samples.getAt(s-1).giveFields().getAt(s) 144 //println studyInstance.samples.getAt(s-1).getFieldValue(sf.name) 145 146 // adding Event domaine + template properties 147 148 138 149 } 150 //println "DOMAINS " +studyInstance.samples.getAt(s-1).parentSubject.giveFields() 139 151 140 //println "DOMAINS " +studyInstance.samples.getAt(s-1).parentSubject.giveFields() 152 //wb.write(fileOut) 153 //fileOut.close() 154 155 response.setHeader("Content-disposition", "attachment;filename=\"${studyInstance.title}_SimpleTox.xls\"") 156 response.setContentType("application/octet-stream") 157 wb.write(response.outputStream) 158 response.outputStream.close() 159 141 160 142 143 wb.write(fileOut)144 fileOut.close()145 161 } 146 162 163 147 164 } -
trunk/grails-app/views/exporter/index.gsp
r1000 r1035 78 78 </div> 79 79 80 <div class="paginateButtons"> 81 <g:paginate total="${studyInstanceTotal}" prev="« Previous" next="» Next" /> 82 <br> 83 <INPUT TYPE=submit name=submit Value="Export"> 80 81 <div class="paginateButtons" id="button"> 84 82 </div> 83 84 <!-- <g:submitToRemote action="test" update="result" />--> 85 86 <!-- <g:submitToRemote action="export" update="[success:'message',failure:'error']" />--> 87 88 <INPUT TYPE=submit name=submit Value="Export"> 89 85 90 </div> 91 92 <div id="result"> </div> 93 86 94 </g:form> 95 87 96 </body> 88 97 </html>
Note: See TracChangeset
for help on using the changeset viewer.