}
// Writing HTML to GoogleDrive
if (writeHtml) {
LOGGER.debug("Writing (to GoogleDrive) HTML for account: " + accountId);
GoogleDriveReportWriter gdrwHtml = new GoogleDriveReportWriter.GoogleDriveReportWriterBuilder(
accountId, dateStart, dateEnd, mccAccountId, credential, ReportFileType.HTML,
templateName)
.withFolderPerAccount(perAccountFolder)
.build();
gdrwHtml.write(mrwHtml.getAsSource());
}
// Writing PDF to GoogleDrive
if (writePdf) {
LOGGER.debug("Writing (to GoogleDrive) PDF for account: " + accountId);
GoogleDriveReportWriter gdrwPdf = new GoogleDriveReportWriter.GoogleDriveReportWriterBuilder(
accountId, dateStart, dateEnd, mccAccountId, credential, ReportFileType.PDF,
templateName)
.withFolderPerAccount(perAccountFolder)
.build();
HTMLExporter.exportHtmlToPdf(mrwHtml.getAsSource(), gdrwPdf, fontPaths);
}
// Writing Drive Doc to GoogleDrive
if (writeDriveDoc) {
LOGGER.debug("Writing GoogleDrive Doc for account: " + accountId);
GoogleDriveReportWriter gdrwDriveDoc = new GoogleDriveReportWriter.GoogleDriveReportWriterBuilder(
accountId, dateStart, dateEnd, mccAccountId, credential, ReportFileType.DRIVE_DOC,
templateName)
.withFolderPerAccount(perAccountFolder)
.build();
gdrwDriveDoc.write(mrwHtml.getAsSource());
}
} else {
// Writing HTML to Disk