I have this code below:
reportPDF = doc.getAs(\'application/pdf\') reportPDF.setName(\'Automated report - \'+ rows[0][0] + ".pdf");