?
Solved

Missing last years detail records in Crystal Report

Posted on 2009-05-20
4
Medium Priority
?
274 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:Datakat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

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

Accepted Solution

by:
James0628 earned 1000 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:Datakat
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 35

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

764 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