Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to recognize a blank or null subreport?

Status
Not open for further replies.

MzKitty

Programmer
Oct 28, 2003
254
US
I am writing a production report in CR 10 that is looking at tickets that were voided and no replacement ticket was written. On Details A is the voided ticket. On Details B, (a subreport), is a list of tickets for the same customer and product that were written in the hour following the the first ticket. If a ticket with the elasped time of < 11 minutes is found, then the subreport is empty or null. When this occurs I want to suppress Details A. The end result is a report that has only void tickets with no replacement ticket. I tried using a shared variable, but Detail A has to occur before the subreport.

I hope that this all makes sense. Thanks for any help you can give me.
Cathy
 
Why does the sub have to be in detail_b? Are you sharing a variable from the main report in order to determine the elapsed time?

-LB
 
I'm linking the ticket date and time to the subreport so I can get the elasped time and I'm also linking the customer ID and product ID to the subreport.
 
You didn't answer my question. Either you are using a shared variable or you have modified the selection formula in the sub. Please show the contents of these formulas.

-LB
 
Here's the selection formula that I am using in the subreport:

{Tkhist1.LocationID} = {?Pm-Tkhist1.LocationID} and
{Tkhist1.TicketDate} = {?Pm-Tkhist1.TicketDate} and
{Tkhist1.CustomerID} = {?Pm-Tkhist1.CustomerID} and
{Tkhist1.TicketTime} > {?Pm-Tkhist1.TicketTime} and
{Tkhist1.ProductID} = {?Pm-Tkhist1.ProductID} and
{Tkhist1.Qty} > 0 and
{@elasped time} > 10 and
{@elasped time} < 60


elasped time is : ({Tkhist1.TicketTime} - {?Pm-Tkhist1.TicketTime}) / 60

and the subreport is set to Suppress blank subreport.

I'm going to try moving my detail information from the voided ticket to the group footer for the ticketno and if a shared variable is 0 or null then suppressing the group footer. I think this will work.

Thanks LB.
 
Yes, that should work if I'm following this correctly. Is the tickettime field a number field expressed in seconds? Otherwise, you'd need to use datediff.

-LB
 
Yes the ticket time is a number field displayed as 13:45:12. Thanks for your help.

Cathy
 
I did finally get this to be in the format that the CFO wanted. I'm doing all of the logic in the subreport and it is now giving me only the voided tickets which have no replacement ticket. Thanks LB for your help.

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top