I have exported pdf by using export-plugin in grails. Now my problem is to put the title in the center of pdf. What code i need to write in the controller to align this title center?
Asked
Active
Viewed 497 times
2 Answers
1
def export={
def data = userService.list(params)
if(params?.format && params.format != "html")
{
response.contentType = grailsApplication.config.grails.mime.types[params.format]
response.setHeader("Content-disposition", "attachment; filename=${params.controller}.${params.extension}")
List fields = ["username","email","clientName","role","status","timeZone"]
Map labels = ["username": "User Name","email":"Email ID","clientName":"Client Name","role":"Role","status":"Status","timeZone":"Time Zone"]
// Formatter closure
def upperCase = { domain, value -> return value.toUpperCase() }
Map formatters = [name: upperCase]
Map parameters = ["column.widths": [0.3, 0.4,0.2,0.3,0.3,0.3]]
exportService.export(params.format, response.outputStream, data.exportData, fields, labels, formatters,parameters)
}
}

laalto
- 150,114
- 66
- 286
- 303

Anand Kushwaha
- 457
- 4
- 15
0
You customizing the icon by not using grails export tag but u can simply creat your own export controller and then u can call the grails export's export service to achive your goal with the following parameter

Ingo Karkat
- 167,457
- 16
- 250
- 324

Anand Kushwaha
- 457
- 4
- 15
-
Excel – Anand Kushwaha May 16 '13 at 08:58