UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Supress Main Report If Subreport Is Empty, Crystal reports 2013    
 
   
jimmy0305
post Nov 20 2015, 12:14 PM
Post#1



Posts: 610
Joined: 16-March 05
From: New York, NY


Hi Everyone!

I have a 3 sub reports and each sub report has a Formula Field (i.e. Acount, Acount1, & Acount2)

Here's the formula on each sub report
CODE
Formula for Acount, Acount1, & Acount2

whileprintingrecords;
shared numbervar aCount:=count({Table_Name.Line})


So as you notice, I am counting the line number on each sub report (If there's any)... The formula is placed on the sub report's footer

So far, I can see that on each sub report, I can see the total

My problem is...

I would like to create and place this formula on my Group Header that if Acount, Acount1, & Acount2 are equal to zero,

Many Thanks in advance.

Jim
Go to the top of the page
 
jimmy0305
post Nov 20 2015, 02:17 PM
Post#2



Posts: 610
Joined: 16-March 05
From: New York, NY


My problem is...

I would like to create and place this formula on my Group Header that if Acount, Acount1, & Acount2 are equal to zero, I would like to suppress the Group Header.


Thanks.

Jim
Go to the top of the page
 
jimmy0305
post Nov 20 2015, 04:21 PM
Post#3



Posts: 610
Joined: 16-March 05
From: New York, NY


I've placed this formula in Main Report's Group Header to count if there are data or if there's a sub report (that exist) below the main report.

My reason behind this formula is, if there's no sub reports below the main report, the Group header will be suppress...

Formula name is aCountTot
CODE
WhilePrintingRecords;
Shared numberVar aCountTot;
Shared NumberVar aCount;
Shared NumberVar aCount1;
Shared NumberVar aCount2;
aCountTot:= aCount + aCount1 + aCount2


But what's happening is... it's not counting the data of the "current" sub report.

Instead, it is counting the "NEXT" sub report's data.

And if there no sub reports, it still counts the next sub report's data even though there are no sub reports.


Any ideas how can I count the "current" or the sub report data?
and also not to count the "next" sub report's data?

Many thanks

Jim
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    11th December 2017 - 04:12 AM