简体   繁体   English

Pentaho报表设计器:如果输出格式为excel,则更改列值

[英]Pentaho Report Designer: Change column value if output-format is excel

Helo, I have report, where I show some photos. Helo,我有报告,在那里我展示了一些照片。 However, if the report is generated as Excel output, I don't want to have the photos there, because the size of generated file is too big in that case. 但是,如果报表是作为Excel输出生成的,则我不希望在其中放照片,因为在这种情况下,生成的文件太大。

Because of that, I want to have those columns empty, if the output format is Excel (or, even not HTML would work). 因此,如果输出格式为Excel(或什至无法使用HTML),则我希望这些列为空。 I have tried to do it through excel:formula in Attributes section of the cell, but it did not work (I guess, it is because its the formula of that excel cell. 我已经尝试通过单元格“属性”部分中的excel:formula做到这一点,但是它没有用(我猜是因为它是该excel单元格的公式。

I have also tried to create Open formula with IF statement, but wasn't able to find any way how to give it output-format as an parameter. 我也尝试过使用IF语句创建Open公式,但是找不到任何方法将其output-format作为参数。

Is there any way how to solve this issue? 有什么办法可以解决这个问题? How to change value of a cell depending on output-format? 如何根据输出格式更改单元格的值? I been trying to find it in Pentaho documentation, but no luck so far.. 我一直试图在Pentaho文档中找到它,但是到目前为止还没有运气。

Select the element you don't want to show and under size & position -> visible , add an OpenFormula by clicking the (+) and add a formula like this: 选择您不想显示的元素,然后在size & position -> visible ,单击(+)添加一个OpenFormula,然后添加一个公式,如下所示:

=NOT(ISEXPORTTYPE("table/excel"))

The available export types can be looked up at Master Report -> Attributes -> output-format . 可用的导出类型可以在Master Report -> Attributes -> output-format查找。

When previewing as eg "HTML" and "Excel", the output format will automatically be set accordingly, so you can simply hit preview without changing that value every time. 当预览为“ HTML”和“ Excel”时,将自动设置输出格式,因此您可以直接单击预览而无需每次更改该值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM