excelpentahopentaho-report-designer

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


Helo, I have report, where I show some photos. 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.

Because of that, I want to have those columns empty, if the output format is Excel (or, even not HTML would work). 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.

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.

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..


Solution

  • 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:

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

    The available export types can be looked up at Master Report -> Attributes -> output-format.

    When previewing as e.g. "HTML" and "Excel", the output format will automatically be set accordingly, so you can simply hit preview without changing that value every time.