Skip to Content
0
Jun 06, 2018 at 07:12 AM

Suppression of column when report type changes

161 Views

Hello,

I am new to crystal reports and have inherited reports which I maintain, one of which is a report that shows deposits and withdrawals for clients within a managed cash account.

The report has a {?Type} parameter with possible values of Net, Deposit & Withdrawal.

In order to only show a net movement per client, rather than individual transaction amounts which make up the net, I have used the WhilePrintingRecords function which the report did not previously show. Previously it showed only the net overall movement.

The actual detail line (individual transactions) and total of deposits and withdrawals by client (GF#4) are suppressed, leaving the net movement per client to be displayed. This is handled in the GroupFooter#3 line. The formula fields are called clinetd and clinetw. It was also necessary so that the sub-total line in GF#1 arrived at the correct total for what is being displayed (i.e. sum of GF#3 lines).

All works well if the report is Net (showing both deposit and withdrawal columns) but when it runs for either Deposit or Withdrawal both deposit and withdrawal amounts are still present. I need to suppress the withdrawal column info if the report is run for Deposits and vice versa.

I already have a Suppress if Zero formatting formula in place for the two formula fields on the GF#3.

Is there a way that I can suppress clinetw fields if report type is Deposit and clinetw fields if report type is Withdrawal? I have tried a number of things but not been successful.

The clinetd formula is:

if sum ({@Deposit}, {@ptysub}) > sum ({@Withdrawal}, {@ptysub})
then sum ({@Deposit}, {@ptysub}) - sum ({@Withdrawal}, {@ptysub})
else 0.00

ptysub is to group for each client.

Is there a way to edit the formatting formula currently used to suppress if zero?

Thanks, in anticipation

Sharon

Attachments