Print Page | Close Window

Hide Blank Lines in Subreport

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22331
Printed Date: 28 Apr 2024 at 10:21pm


Topic: Hide Blank Lines in Subreport
Posted By: Heavenite
Subject: Hide Blank Lines in Subreport
Date Posted: 14 Jun 2017 at 11:38pm
Hi all,

I'm hoping you can help out, I've tried for the past week to fix this, but I just can't figure out a way.

I have a report which contains a subreport. In the subreport I have a formula that looks to see if the customer has a certain tax code in a field, if so I want Crystal to put a "Reverse Charge" text onto an invoice.

My formula reads as follows:
IF {TABVACBPR.VACBPR_0} = "EUR" then "Reverse Charge" else ""

This works absolutely fine, but the report still pulls through all of the other tax codes, but places them as blank lines. (There are 7 tax codes, so it creates 6 blank lines, with one of them saying "Reverse Charge").

I have attempted to put the formula inside a text object and "Suppress Embedded Field Blank Lines" but this makes no difference.

Is there any way I could create a formula that would check TABVACBPR to see if the client was using an EUR tax code and put in the Reverse Charge text, without pulling through the rest of the lines?

I hope this makes sense, please let me know if there's any more information that could help.

Thanks in advance,

Solomon



Replies:
Posted By: DBlank
Date Posted: 15 Jun 2017 at 3:17am
I think you mean you have a sub report that is displaying text but you now want that same subreport text to conditionally suppress rows in the main report.
If so you need to create shared variables and pass the sub report value to the main report and use the shared variable result as your suppression criteria.
make sure the sub report executes in a section that is 'above' (e.g. report header) the detail section


Posted By: Heavenite
Date Posted: 15 Jun 2017 at 11:27pm
Thanks DBlank. I'm not entirely sure how to do that, but I'll go and investigate (i.e. Google ;)) now and see if I can work out how to do that.

Thanks,

Solomon


Posted By: Heavenite
Date Posted: 29 Jun 2017 at 1:49am
Hi DBlank,

I've attempted to do this, but am a bit confused about the order.

Should I put in two separate Formulas? One to do the IF and then one to return the Shared StringVar? At the moment it's still displaying all of the blank rows that I didn't want displaying.

Thanks,


Posted By: DBlank
Date Posted: 03 Jul 2017 at 7:09am
I am still unclear if the 'rows' you want to suppress are in the sub report or the main report.



Print Page | Close Window