Solved

Missing last years detail records in Crystal Report

Posted on 2009-05-20
4
268 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now