Solved

Missing last years detail records in Crystal Report

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

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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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