Changeset 1761

Show
Ignore:
Timestamp:
12-04-11 14:36:36 (3 years ago)
Author:
s.h.sikkema@…
Message:

assay excel export now writes to a temporary file first to prevent memory issues

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/AssayController.groovy

    r1752 r1761  
    55        def assayService 
    66        def authenticationService 
     7    def fileService 
    78 
    89        static allowedMethods = [save: "POST", update: "POST", delete: "POST"] 
     
    200201                try { 
    201202 
    202                         assayService.exportRowWiseDataToExcelFile(session.rowData, response.outputStream) 
    203                         response.outputStream.flush() 
     203            def file = fileService.get('tempAssayExportFile') 
     204            def os = file.newOutputStream() 
     205 
     206                        assayService.exportRowWiseDataToExcelFile(session.rowData, os) 
     207                        os.flush() 
     208 
     209            response.outputStream << file.newInputStream() 
     210 
     211            file.delete() 
    204212 
    205213                } catch (Exception e) {