使用pentaho水壶动态命名Excel工作表 [英] Dynamic naming of excel sheets using pentaho kettle

查看:96
本文介绍了使用pentaho水壶动态命名Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我进行了一个转换,该转换包含使用Excel编写器步骤将数据从表输入步骤写入Excel工作表的顺序步骤.

I have a transformation with sequential steps of writing data from a table input step to Excel sheets using Excel writer step.

工作表名称基本上在内容"选项卡的工作表名称框中提供,这反映在电子表格中.

The sheet names are basically provided in the sheet name box in content tab which was reflecting in the spreadsheet.

代替按定义表名,可以从表的列值动态获取表名.

Instead of per-defining the sheet name, is there any possibility that the sheet names can be dynamically taken from column value of the table.

例如:说有一个表节和列section_name,stud_name 因此,我需要将部分名称显示为excel工作表名称,并在该部分显示该特定工作表的学生姓名.

Ex: say there is a table section and columns section_name , stud_name so i need to show section names as excel sheet name and student names in that section for that particular sheet.

因此,每张纸代表该班级的学生数据的不同部分名称.

so each sheet represents different section names with student data of that class.

有人可以帮我用水壶做什么吗?

Can anyone help me how to do this in kettle?

预先感谢

推荐答案

为了动态定义"Excel输出/编写器步骤"的图纸名称,可以通过将变量分配给图纸名称"来实现.

In order to dynamically define the Sheet Name of an "Excel Output / Writer Step", you can do it by assigning a variable to the "Sheet Name".

在您的情况下,您首先要通过两个转换步骤创建一个水壶作业.在第一个转换中,使用代码定义变量(例如:COLUMN_NAME).此变量中的值将用作工作表名称.

In your case, you first create a Kettle Job with two transformation step. In the first transformation, use the code to define a variable (say : COLUMN_NAME). The value in this variable will be used as the sheet name.

在第二个转换中,使用在第一个ktr中定义的变量(即COLUMN_NAME)作为工作表名称.检查下面的图像以了解Excel Writer步骤:

In the second transformation, use the variable defined in the first ktr (i.e. COLUMN_NAME) as the sheet Name. check the image below for the Excel Writer Step:

这将在pentaho中提供动态工作表名称.希望这就是您要寻找的:)

This will give a dynamic sheet name in pentaho. Hope this is what you are looking for :)

这篇关于使用pentaho水壶动态命名Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆