Not working Output name pattern when use Groovy Scripts

I’ve two issues:

1-: when checked Is custom to be able add groovy script to rename the

${Root.title}.pdf
where title is a result of the script:
[['title' : ('Report for ' + params['author'].firstName+ ' ' + params['author'].lastName)]]

Untitled

2- how to rename exported .zip folder when use listPrintBtn.

I successfully use Output name pattern for only one param but when I put two params, I only got the first param.
Untitled-1

Please help me to find out how I can set up this Output name pattern with multiple params using my entity. e.g. idNumber_FirstName_CurrentDate.pdf

Best Regards,
Bakr

Hi, @bakr.milibary!

Custom definition field defines custom content for template file, not for output name pattern. You could create Groovy dataset in Root report band and place script there.
Unfortunately, only the first parameter is processed in output name pattern. You could also work around this problem forming parameter for output name pattern pattern in the dataset. For example, create report band with name Title and create Groovy dataset for that report with script like following:

return [['titleParam' : (params['idNumber'] + '_' + params['FirstName'] + '_' + params['CurrentDate'])]]

Then you could get result of the script by name ${Title.titleParam} in your output name pattern.

Regards,
Sergey

1 Like