Conditional Element on Report

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Conditional Element on Report

Post by kklosson »

I want to print a text element on a report based on whether or not any child records exist related to the object of the report. For example when no Purchases exist for a Customer report. In a process, I could use:

IF Customer.Purchase IS UNDEFINED THEN...

This does not seem to work in the condition for a report element. I also tried to use ELEMENT_COUNT, but in reading the docs, this does not seem to be useful here.

Any thoughts?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Conditional Element on Report

Post by Jaymer »

If You can put that conditional text element online by itself, then print it via a sub report.
Use a FIND to locate the Child.
For the sub report check the option that says don’t print if no data exists/something like that.
Have sub report trim down to just print that static text and then it exits.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Conditional Element on Report

Post by kklosson »

Thanks. It so happens this is a subreport. This element is in the Title band and the subreport is set to print all but the detail band if the report is empty.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Post Reply