Jump to content
  • 0

Hide a row in a tabular datapage report based on a calculated field


alanhoffman

Question

Hi.

I have a tabular datapage that produces a report that shows 4-5 columns showing name, town etc. - and each row is for a different "Member_ID".

One of the columns is a calculated field ("Entry_Count") that uses the Select function to count the records in another table for each Member_ID.

I would like this report to hide any row where the count is zero.

Any suggestions would be greatly appreciated...

Perhaps there is  some coding for this (I assume to be placed in the header or footer).

Many thanks...

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @alanhoffman,

 

I understand that you want to hide rows based on the result of your calculated field. You need to have a custom script to achieve that. 

First, you need to add HTML Bolck, disable the HTML Editor or click the Source button. Then, paste this code:

<a id="visi[@field:UniqueID]">

<script>
var isi = document.getElementById("visi[@field:UniqueID]");
if([@calcfield:1#] = 0){
isi.parentNode.parentNode.style.display = 'none';
}
</script>

 

Remember to change the '[@field:UniqueID]' to the name of your UniqueID field and the '[@calcfield:1#]' to the corresponding name of your calculated field. 

 

The solution is similar to this article: Dynamically Change the Background of a Results Page Record

 

Hope this helps. 

 

-kristina

 

Link to comment
Share on other sites

  • 0

Hi - Just an update, here are the other ways for you to hide column in the Tabular Report:

Without Download/Sort Options:

table[id*='cbTable'] > tbody > tr[class*='cbResultSetTableHeader'] > th:nth-child(1), td[class*='cbResultSetData']:nth-child(1){

    display:none !important;
  
}

With Download/Sort Options:

table[id*='FreezeTabularHeaderObj'] > tr[data-cb-name="header"] > th:nth-child(1), td[class*='cbResultSetData']:nth-child(1), #target table:nth-of-type(1) th:nth-of-type(1), #target table:nth-of-type(2) th:nth-of-type(1){

    display:none !important;
  
}

Replace 1 with the position order of column to be hidden.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...