Print unique rows based on a column and disable a column from printing!

Print unique rows based on a column and disable a column from printing!

akrinisakrinis Posts: 2Questions: 2Answers: 0
edited June 2017 in Free community support

Hello,

Let's say that we have two columns "client ID" & "Product" with follow data
Client_1 Product_1
Client_1 Product_2
Client_1 Product_3
Client_2 Product_1
Client_2 Product_2

So, I would like to print only the 1st column and only the unique values! So, it would be
Client_1
Client_2

Thank you

Answers

  • allanallan Posts: 56,187Questions: 1Answers: 8,899 Site admin

    Good question. Yes it is possible - although you'll need provide a function that would select the rows you want to export.

    Specifically, use the exportOptions property of the print button type, which is passed to the buttons.exportData() method. That let's you use a row-selector - which can be given as a function. As a function it has access to the data in the table, so you can decide to include a row or not based on whatever logic you want (in this case, if your function as seen the data already or not).

    There is probably a simpler way, but that's the one that springs to mind.

    Allan

This discussion has been closed.