|
-
May 29th, 2003, 10:22 AM
#1
Thread Starter
Frenzied Member
In crystal reports how can I .......
I want to count the number of lines printed in the details setion of a group, not the total number - I have certain lines suppressed.
I have a section suppressed if a=b and c=d
So I have tried creating a count in the details section
whileprintingrecords;
NumberVar RecCount;
if a=b AND c=d then
RecCount := RecCount+1
I am also resetting this variable to zero in the group header, but it just doesn't seem to be holding a count??????
-
May 29th, 2003, 10:56 AM
#2
Frenzied Member
I know this is painfully obvious, but can't you just add
WHERE a=b AND c=d
in the record selection formula?
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
May 29th, 2003, 11:15 AM
#3
Thread Starter
Frenzied Member
No because a; b; c .......... are other formulas evaluated on WhileprintingRecords ............ Anyway, I've gone past that.
The problem now is:
If I don't have any records appearing in the details setion - due to the suppression formula, I don't want the group header or footer appearing.
I have a formula in my footer that calcuates the number of records that appears in each group. TROUBLE is that the formula isn't calculated until after the header is printed so it won't suppress the header.
-
May 29th, 2003, 02:54 PM
#4
Are your formulas based on database fields or some other criteria? You can create a Selection Formula for Groups (as well as Records) - maybe that is an option for you (ie throw out the groups/records beforehand so the suppression formulas are not needed.
I don't know if this will work but have you tried using WhileReadingRecords?
There is a topic in the help file called ReportProcessingModel that explains a litte how Crystal works, maybe it will give you some more ideas.
-
May 30th, 2003, 04:34 AM
#5
Frenzied Member
Over the years (I started with Crystal Reports 2 !!) I have made a number of 'rules' regarding the use of Crystal Reports and I pass these rules onto other developers as and when they seem necessary.
They are:
1. Switch off "Save Data with Report"
2. Don't let Crystal do any work. Create a view.
3. Work from the inside (details) out, not top to bottom.
4. Just because it claims it can, it doesn't mean you should.
..
(there are more, but I think that will give you all the information you need)
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
May 30th, 2003, 05:03 AM
#6
Thread Starter
Frenzied Member
That's what I'll do then! Thanks
-
May 30th, 2003, 06:01 AM
#7
Frenzied Member
I know it may mean a lot of work but VIEWs are so much more powerful than Crystal. We very rarely use formulae in reports these days - in fact we don't even join tables in reports - we just create a view that does everything we want and then get Crystal to simply 'pretty it up'.
It makes it much easier in the long run. Trust me!
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|