nwwells/grails-export — pull request #2 by huweihong (2013-06-04 07:38:59+00:00)
Title: Add logoimage and title for excel eport file

In my project, we need to export logoimage and table title into excel.
I change some code in DefaultExcelExporter and ExcelBuilder.
Using:
InputStream is = new FileInputStream(imagepath)
byte[] image = IOUtils.toByteArray(is)
def excelReport = []
excelReport<<[image:image
,width:10,height:2000
,mergeColumn:0,mergeRow:0,mergeToColumn:fields.size()?fields.size()-1:0,mergeToRow:0
,beginColumn:0,beginRow:0,crossColumn:6,crossRow:1
,title:"your table title"
,titleformat:[fontfamily:'arial',bold:true,'size':20,alignment:'CENTRE']]
exportService.export( 'excel', response.outputStream, excelReport, fields, labels, formatters, parameters )

if excelReport do not has 'image',the export excel file is as before.