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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show a 'specified' group with no data inside

Status
Not open for further replies.

yuenie

Programmer
Jul 20, 2000
15
0
0
HK
The specified group name will be automatically suppressed if no data was found inside. Can it show a '0' instead? Thanks for help.
 
I don't know if this will work, but something to try.&nbsp;&nbsp;Create a formula that states something like:<br><br>If IsNull({FieldName]) or Trim({FieldName]) = &quot;&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;0<br>Else<br>&nbsp;&nbsp;&nbsp;&nbsp;{FieldName]<br>Then use this formula in place of the field.<br><br>Hope it helps.&nbsp;&nbsp;Keoki<br> <p>Keoki<br><a href=mailto:gb@cardinalhill.org>gb@cardinalhill.org</a><br><a href= > </a><br>
 
Thanks Keoki for your response.<br><br>But I think I have oversimplified my problem. My situation is that I have to GROUP the results generated from a formula:<br><br>{field_1} - {field_2}<br><br>The GROUP has been 'specified' into 0,1,2....29. My problem is that, for example, none of the results is 15, then the GROUP
 
Thanks Keoki for your response.<br><br>But I think I have oversimplified my problem. My situation is that I have to GROUP the results generated from a formula:<br><br>{field_1} - {field_2}<br><br>The GROUP has been 'specified' into 0,1,2....29. My problem is that, for example, none of the results is 15, then the GROUP '15' will not be shown. What I want is something like<br><br>Group&nbsp;&nbsp;&nbsp;&nbsp;Count<br>-----&nbsp;&nbsp;&nbsp;&nbsp;-----<br>&nbsp;15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br><br>As simple as that? Thanks very much, It really bothers me for a while.<br><br>&gt;yuenie.
 
I'm having the EXACT same problem so an answer would definitely be appreciated
 
I found a workaround to this problem by making the group a sub-report, then using a formula in the report footer to evaluate the count.&nbsp;&nbsp;if it was 0 or null, then output
 
Thanks NTSGuru. But my concern is that I have to make 30 subreports as I said the range is 0,1,2...29. Am I right?<br><br>Also, based on that result, I have to draw a bar chart (with running totals as well). It may cause problem if I used 30 subreports or 30 formulaes for generating the result.<br><br>&gt;Yuenie.
 
Here's an idea.<br><br>Create a formula that checks to see find the difference of the next group from the current group:<br><br>Create a formula such as &quot;Next Group Change&quot; like: <br>Next({@Group Formula}) - {@Group Formula}<br><br>(Where {@Group Formula} = {field_1} - {field_2})<br><br>Create a Group B Text Formula:<br>If ({@Group Formula} + 1) = ({@Group Formula} + {@Next Group Change} - 1)<br>Then ToText({@Group Formula} + 1)<br>Else ToText({@Group Formula} + 1) + &quot;-&quot; + ToText({@Group Formula} + {@Next Group Change} - 1)<br><br>Add a section below in your group footer, so you have a group footer A & B.<br><br>Conditionally suppress section B if Group Change is less than or equal to 1. (Using a formula such as {@Next Group Change} &lt;= 1)<br><br>Put the Group B Text Formula in line with the Group field.&nbsp;&nbsp;Place a text box with a &quot;0&quot; in it in line with the counter fields.<br><br>If you have a gap of more than 1 group it may look like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;<U>Group</U> &nbsp;&nbsp;&nbsp;&nbsp;<U>Count</U><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5<br>&nbsp;&nbsp;&nbsp;&nbsp;17-20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6
 
thanks very&nbsp;&nbsp;much Nilsen. It works well and I hope my client will accept X-Z rather than X Y Z. He's quite a fuzzy person.<br><br>&gt;Yuenie
 
Nilsen's example of group checking is the closest you will get. There is no way of showing a group in the original &quot;perfect&quot; order when no data is returned from the Crystal side of the processing. There are various hardcode workarounds to dummy up a report to make it look like groups but not act like them dynamically.<br><br>The only workaround that I have found is to use a stored procedure that includes a default value for every group needed. Of course you will have to know how the report will be designed to do this.<br><br>The report I'm referring to used a stored procedure to show all 12 months of the year - but the dilemma, of course, was missing months when no date was found for that group. The client did not want to see Jan. Feb. May. July - so the only fix was a stored procedure that checked for the date and inserted a value equal to the month I was looking for. It was extremely tricky - and there were many other considerations as well, but in the end it worked. <br><br>Having groups appear regardless of data returned has been a wish for Crystal report writers everywhere for many versions. <br><br><br> <p>Cody ford<br><a href=mailto:codyjford@hotmail.com>codyjford@hotmail.com</a><br><a href= > </a><br>VB, VBS, Seagate Info/Crystal Reports<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top