Solved

Missing last years detail records in Crystal Report

Posted on 2009-05-20
4
270 Views
Last Modified: 2012-06-27
I have a report to show sales counts of items using scanned data from stores.  I want to compare last years to current years.  The only record selection I'm using is the store number.  There is a parameter for starting date and ending date the user would enter.  If the detail record is in this years date range, the count is added to a variable, CYitem.  If the detail record date is in last year, for the same time period (say a month) then the count is added to another variable, lyitem.   I never see detail records for last years sales, but the summary at the next level has a total in it.  What could cause the records not to show up?  The real difficulty is if there is 0 sales in current year of an item, but there are sales in last year.  This makes the listed items not total down to the actual summary.
0
Comment
Question by:magneticskg
  • 2
4 Comments
 
LVL 2

Expert Comment

by:vetaldj
ID: 24436711
Can you post your formula where you adding them?
0
 
LVL 34

Accepted Solution

by:
James0628 earned 250 total points
ID: 24438128
So, you're saying that you don't see records for last year, but you get totals for last year?  That would imply that the report is reading the records, but not showing them to you.

 In the report Design view, right-click the name of the section that shows the detail records and select Section Expert.  Is the Suppress or "Suppress Blank Section" option checked?  If you click the formula (X+2) button beside each of those options, is there anything there?

 You could also go to Report > "Selection Formulas" > Group and see if there is anything there.

 James
0
 

Author Comment

by:magneticskg
ID: 24454478
I did not realize that Crystal Reports can create a Group Select formula without direct input from the human report writer!!  Learning experience, and thanks for pointing me in the right direction.  Problem solved.  The group selection (for whatever reason) was selecting the date range for current year so I just or'd in the formulas to calculate the dates for last year and all is well!!
0
 
LVL 34

Expert Comment

by:James0628
ID: 24456080
Well, someone/something had to put the formula there.  CR won't just do it on its own.  If you didn't do it, then someone else must have.  The obvious guess is that someone wanted the report to include the last year sales, but not actually show the details on the report.

 FWIW, if the report is only supposed to include records within a certain date range for this year and last year, that selection should be in the record selection.  If it is, and you want to see both, you can just remove the group selection.  The record selection will limit the records included in the report.  The group selection was simply to suppress the records from last year, so that they didn't show.  If you want to see them too, you can simply remove the group selection formula (rather than add the dates from last year to the selection).  FWIW, I think it'd be "cleaner" to remove the selection formula if you don't need it anymore, rather than modify it to include everything.  If you leave the formula, you may run into this same situation somewhere down the line (where you can't figure out why the report isn't showing some records).  If you like, instead of deleting the lines in the formula, you could comment them out (put // in front of each line).  That way they won't actually do anything, but they'll still be around for reference.


 Anyway, glad I could help.

 James
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question