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

Need to show month even when no data exists. Help!!!

Status
Not open for further replies.

jaxflorida

Technical User
Apr 16, 2002
27
US
Hello,

I am graphing data that will select only data in a date range. My problem is that if I only have records for, say Jan, Mar, and Jul I still need the other months between Jan and Jul to show as zero if there is no data.

I am using a parameter to gather Start and End Dates and then using the Select Expert to chose which records I want.

Part of the reason I don't know where to start is because the selected area could be a couple of months (01/98 to 04/98) or it could span years (03/96 to 04/02).

I have only been using Crystal Reports for about a month and this one seems to be quite difficult.

I appreciate any help someone can give!
 
Crystal won't automatically chart or group on data that doesn't exist. There are some workarounds that require some advanced techniques that might be beyond your first month.

For instance you could use the techniques described in faq149-243 for manual cross-tabs. You could then have a grand total for each month, even if there wasn't data. However, you need to 'hard code' these months. Since you have no fixed range you would need to write some formulas to 'roll' the fixed months forward based on your date range. Month 1 could be the month of your start date, Month 2 could be the following month, etc for as many months as you need to chart. You could then create an advanced chart that charts all of these grand totals. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thank you for responding,

I see what you are saying. I have had time to think over this weekend and have come up with an idea I hope might work. Is there any way to create a date array that can be populated with zeros initially and then when I read my "real" records, I write over the zeros? If so, can I graph based on an array?

Once again,
Thanks
 
Just some data, any data, in your database so crystal can "find" it. Zeros are fine. I have done this several times to make a cross tab work.

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
dgillz,

Thanks for responding. Do I need a number variable array or a date array for what you are saying?
 
I have never done what you are talking about, what I was talking about is to manually enter the data in your database with the dates in question for the top of your crosstab and zeros for the summarized field.

I believe if your approach works you would need both a datavar array and a numbervar array.

Let me know if you pull this off. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
I don't think you can graph based on the array itself. You could parse the array into a group of fields, and chart those fields, but only (I think) if the array were built while reading records. Not much different in the end than using the manual cross-tab technique described above. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top