Forum Discussion

CrystalMa's avatar
CrystalMa
Qrew Trainee
6 years ago

Is it possible to conditionally hide/show a report link URL in a table report?

I have a parent table and a report link to a child table. In the parent table, I'd like to be able to conditionally show and hide the report link to the child table based off whether the parent record has child records or not. 

In my current setup, parent records without child records have report links. When you click on the link, it leads to a junk table saying that no child records were found. I'd like to eliminate this to prevent confusion.

I tried creating a Formula - URL field but the problem is that a report link generates a new query and query ID each time it's clicked; so I can't write a regular rule for the URL.

Does anyone have insights on how exactly the query is generated? Or any ideas on a workaround?

Thanks!

5 Replies

  • Is the report link embedded in a form? If so, create a summary field to count the number of child records. Then in a form rule, create a rule that states: If the summary field equals 0, hide the report link. Or place the report link in a section and hide the section.
  • Hi Gil--thanks for responding! I actually want to show/hide the report link within a table report. This table report needs to go on a home page--otherwise, I'd use a form and form rules.
  • Crystal, I would have given the same answer as Gil, but now you have added the twist that this is on a report and not on a form.

    So Plan B.

    A report link field type just runs a report but with an extra filter as defined on the report link setup. (for example where [Record ID#] on the Parent matches the value in the field [Related Parent] on the child record.  So let's just find another way to run a report as a Report link field cannot be a "formula Report link field type as that does not exist.) 

    You can make an <ask the user> report on the child table which is waiting for the answer to the [Related Parent].  

    Once you create that report and run it and and observe the URL, then you know what we need to mimic in our URL formula.

    So the URL formula would be something like,

    IF([# of child records]>0,

    URLRoot() & "db/" & [_DBID_table name from advanced properties goes here]
    & "?a=q&qid=xx&nv=1&v0=" & ToText([Record ID#]))

    where xx is the report number of the <ask the user> report.
  • This worked great! Thank you for explaining the process to me as well so I can apply the solution to other situations :)