Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to suppress row conditionally in crystal repor Post Reply Post New Topic
Author Message
bandarna
Newbie
Newbie


Joined: 02 Oct 2012
Location: United States
Online Status: Offline
Posts: 10
Quote bandarna Replybullet Topic: How to suppress row conditionally in crystal repor
     Posted: 04 Oct 2012 at 12:24am

I have a main report and subreport. It is linked with exp_vchr_id. It is working fine. Executing each row level for each exp_vhr_id and populating data.
However I need to modify sub report to pass a parameters in to it like p_elemet1,p_element2 this is creating a problem for me.

After I merged my subreport into my main report, when I ran report I am entering values for p_elemet1,p_element2, then subreport data is showing wherever it matches with parent exp_vchr_id and all other rows I am displaying only parent data not subreport data.
What I wanted to do now is I wanted to suppress parent row whenever no data found from the subreport.
Here is what I did:
1. Created a shared variable in sub report as:
Formula Field (v_code_blk)
whileprintingrecords;
shared Stringvar v_gl_code_blk := rtrim(ltrim({exp_vouchr_itm.gl_code_blk}));

2. Used that variable in main report as:
Created a formula field as
whileprintingrecords;
shared Stringvar v_gl_code_blk
3. In details section where my main repot data and subreport data is located, selected Section Expert  open the X-2 for Suppress(No Drill-Down) formula, and coded as follows
if IsNull({@v_code_blk}) then true else false

but it is not suppressing.

If I change code like this (reverting true false)

if IsNull({@v_code_blk}) then false else true then it is working and suppressing all the rows.

I need a help!

 

Regards
~NB
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 04 Oct 2012 at 2:36am
is the string actually an empty string '' and not a null value?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Oct 2012 at 3:15am
If you're trying to suppress a row above where the subreport is located, this won't work.  The subreport would have to process prior to the section that you want to suppress.
 
Are you getting your data through linked tables, a command, a stored procedure, or a universe connection?  I might have another way to do this depending on the answer to this.
 
-Dell
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum