I am a fairly new developer in Grails using STS 3.2 (grails version 2.2.0) and I have an application where I want to export data from a GSP to PDF format. I have installed the Export 1.5 plugin and have a reportController with the following:
def pdf = { results->
def table = results['tables'][params.reportNum.toInteger()]
def headers = table?.getAt(0).collect{ it.key }
def rows = table*.collect{ cleanNull(it.value.toString()) } //data
exportService.export("$params.renderAs", response.outputStream, headers, rows, parameters)
}
Can someone help me get this wired up correctly? I do know that the exportService expects this, but not sure if I have everything collected that I need to to get this to work:
export(String type, OutputStream outputStream, List objects, Map formatters, Map parameters) }
I hope I have been clear with my question...Thanks in advance!