且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Pentaho:如何将单个Excel文件拆分为多个Excel工作表输出

更新时间:2023-01-23 13:23:46

您需要将行(员工姓名)复制到内存中,然后将其循环到excel文件中以生成带有员工姓名的多个工作表.我已经在位置中上传了代码.您可以查看它.

You need to copy the rows (employee names) into memory and then loop it across the excel file to generate multiple sheets with employee names. I have uploaded the codes in this location. You can view it.

首先,我接受了excel输入,并使用复制行以生成结果"步骤将数据加载到内存中.

First of all, i took an excel input and used "copy rows to result" step to load the data to the memory.

在第二步中,循环内存中的所有数据,并将其跨excel文件写入.您可以通过启用将先前的结果复制到参数"来循环文件,并且对每一行执行"将对每一行运行.查看下面的图片:

In the Second Step, loop all the data in the memory and write it across the excel file. You can loop the file by enabling the 'copy previous results to parameter' and 'execute for every row' will run for every single row. Check the image below:

最后,当将文件写入excel文件(使用Excel Writer步骤)时,请确保每次上一行都来自上一个.步骤被插入到同一文件中.请检查下面的图像.

Finally when writing the files in an excel file (using Excel Writer Step) make sure that every time a row is coming from prev. step is getting inserted into the same file. Check the below image for this.

我已在驱动器中上传了示例代码.希望对您有所帮助:)

I have uploaded a sample code in drive. Hope it helps :)