Print Page | Close Window

Pulling data even when nothing is populated?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16244
Printed Date: 29 Apr 2024 at 2:06am


Topic: Pulling data even when nothing is populated?
Posted By: dawnh44
Subject: Pulling data even when nothing is populated?
Date Posted: 20 Apr 2012 at 8:35am
Hello everyone,
 
I have a report that pulls data when there is a date within the parameter fields.  I need it pull the data if there is nothing in the parameter fields, and populate the data with 0's.  So, if the act_close_dt is between 4/20/12 and 4/21/12, then pull the data, but if there's nothing then put 0 in the fields.  Any ideas? 
 
date({S_SRV_REQ.ACT_CLOSE_DT}) in date( mailto:%7b?@start_dt - {?@start_dt }) to date( mailto:%7b?@end_dt - {?@end_dt }) and
{S_SRV_REQ.SR_STAT_ID} <> 'Cancelled' and
(isnull({S_SRV_REQ.SR_PROD_VERSION}) = true or {S_SRV_REQ.SR_PROD_VERSION} <> 'Email') and
{S_SRV_REQ.RESOLUTION_CD} <> "copay penalty"
 
Thank you in advance.



Replies:
Posted By: lockwelle
Date Posted: 23 Apr 2012 at 4:17am
Well....
SQL returns an empty set...there no are rows, so there is nothing there, so CR won't print anything.
 
What you could do is create the values in 'new' detail section that you dynamically hide if there are any rows...or conversely show if there are no rows of data.
 
I don't know of a function to check for no data off the top of my head, I can see working around it with formulas, but I would check for a way to determine if there rows first.
 
HTH



Print Page | Close Window