Finally managed to do it with this code:
params.put("_file", "iResume.jasper")
params.put("_format", "DOCX")
params.put("user_id", 1)
println params
def reportDef = jasperService.buildReportDefinition(params, request.getLocale(), [])
def file = jasperService.generateReport(reportDef).toByteArray()
I took this from the Jasper taglib and the controller code. This is kind of Voodoo programming cause I don't know what the last param []
is for, but it works. Will be grateful if anyone can clarify what's going on here.