Any Crystal Reports Wizards Here?
-
I've had to reluctantly learn Crystal Reports to develop a multitude of reports for one of our systems that the vendor has refused to develop without a hefty development fee. #JustOneOfManyHats
In any rate, I have a report that pulls the most recent record from a given table. The way I do this is basically I pull all records that match my criteria, sort them in descending order based on their entry date, then put the desired fields in the report header (so only the first record shows). This works beautifully.
However, I've been asked to display the second record in said scenario above if one of the fields matches a field in the first record. Ok, simple enough (or so I thought).
I moved the fields down to the details section and then set a suppression formula as so:
{table.field} <> previous({table.field})
However, it doesn't display the second record. Even if there are only two records and the field's match.
I suspect this is probably due to the order of operations in Crystal Reports. I don't know when it sorts vs when the suppression logic comes into play. I tried adding "whileprintingrecords;" to the suppression logic but it didn't seem to help.
Any ideas?
-
So you need to show two records, if the second record matches a particular field in the first record correct?
Why not create a sub-report that will list all records that match anything in the first record?
-
@DustinB3403 said in Any Crystal Reports Wizards Here?:
So you need to show two records, if the second record matches a particular field in the first record correct?
Why not create a sub-report that will list all records that match anything in the first record?
Because this is already a sub-report.
The desired output is to show the newest record. If the second newest record has the same "name" as the newest record, I need to display both (as this is a flag for the users of said report that they need to fix something in the system).
-
I THINK I KNOW WHATS HAPPENING!
The first record is getting suppressed because it doesn't have a "previous" record to match to!
So I just need to implement logic to say "if this is record 1 don't do anything".
-
Without seeing the report / database it's difficult.
But I understand a bit better.
What is your filtering parameter setup for?
-
BOOM. Adding not(OnFirstRecord) to my logic makes it work beautifully.
-
Glad you got it sorted, wasn't to bad was it?
-
This post is deleted! -
@aaron said in Any Crystal Reports Wizards Here?:
I'm not a wizard, but have used it before and you have my sympathy for even touching it.
I don't think Crystal is that bad at all really.
It's just a matter of correlating the database records and aligning them to the tables that you need the data on. Everything else is often as simple as just doing the math.
-
This post is deleted! -
@DustinB3403 said in Any Crystal Reports Wizards Here?:
@aaron said in Any Crystal Reports Wizards Here?:
I'm not a wizard, but have used it before and you have my sympathy for even touching it.
I don't think Crystal is that bad at all really.
It's just a matter of correlating the database records and aligning them to the tables that you need the data on. Everything else is often as simple as just doing the math.
Database management is my least favorite part of my job
-
@DustinB3403 lol, no it wasn't.