コード例 #1
0
    def ReportToExcel(self, reportName='Report'):

        # Create a Pandas Excel writer using openpyxl as the engine

        outputPath = './Resources/Output/' + reportName + '.xlsx'
        writer = ExcelWriter(outputPath, engine='openpyxl')

        # Write each dataframe to a different worksheet.

        sn = 0
        for df in self.__listOfDataFrames:
            df.to_excel(writer, index=False, sheet_name=self.__sheetNames[sn])
            sn = sn + 1

        writer.index = False

        # Close the Pandas Excel writer and output the Excel file.
        writer.save()