Pentaho

 View Only

 How to export only some table columns?

Claudio Battaglino's profile image
Claudio Battaglino posted 07-24-2023 07:06

Hi,

I have a CDE Dashboard with a table that shows some data.

I've added  a button with this Javascript to export the data of the table:

function exportTablePaInCsv(e) {
  return this.Dashboards.getComponent('render_TabellaPa').queryState.exportData('csv')
}

This exports all the columns of the table.

Is it possible to export only some columns of this table?

Thank you very much

claudio

Claudio Battaglino's profile image
Claudio Battaglino

I'm reading the documentation of the exportData function: https://help.hitachivantara.com/Documentation/Pentaho/8.2/Developer_Center/CDF_API/cdf.queries.CdaQuery#exportData

Probably I can use the overrides parameter, but there are no examples, how can I override a query?

Or probably I can use the export Options with the parameters: columnHeaders and dtSearchableColumns, but again there are no examples or tutorials.

They are objects, but do you know how to use them?

Thank you.

Petr Prochazka's profile image
Petr Prochazka

Hi Claudio,

IMHO overrides object is for query definition object. And columnHeaders parametr is type Boolean (true|false) and enables|disables column headers in export file.

Output columns are managed by CDA descriptor (.cda) file and <Output/> element. More information you can find in sample examples in plugin-samples directory.