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

Show missing groups on report

Status
Not open for further replies.

OneTruth

Programmer
Jan 6, 2011
2
US
I know I'm close but I just can't tie a bow on this one. My possible groups are: Business Critical, High, Standard and Scheduled. If there is no data for one group, I want to display it anyway.

I have been advised by a programmer at Crystal to create an "array formula" like this:

If IsNull{table.field} then sum_variable := 0
Else sum_variahble := {table.field}

I'm perplexed though on where I tell Crystal what all of the groups should be so it can determine which ones have data and which ones do not. I've tried declaring an array variable and setting it to MakeArray("Business Critical", "High", "Standard", "Scheduled") but I get an error telling me that the result of a formula cannot be an array.

I would appreciate any nudge in the right direction. This is driving me batty!
 
Since it's just four categories, the simplest solution is a 'Mock Crosstab'. This is something that looks like a Crosstab, but in fact you define each column yourself, normally as a running total. This would need to go in the report footer, because running totals count as the reports 'run' and they will not be complete until then. Crystal should have included an example along with the Crosstabs.

You can save a little time by doing a paste to a dummy report, changing the name and then pasting back. In Crystal 11.5, you can also duplicate formula fields using the Field Explorer.

Each running total will count the record if it was within the criteria - in your case, Business Critical, High, Standard or Scheduled.

Forget about arrays - they are awkward to use in Crystal, and you can usually get the same result by grouping, crosstabs, mock-crosstabs or subreports.

PS. This is based on Crystal 11. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
It is Crystal 2008.

Why didn't I think of that?!? Thank you!

I love the duplicate formula feature!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top