Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal Report Help Suppress Details Post Reply Post New Topic
Author Message
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Topic: Crystal Report Help Suppress Details
    Posted: 24 Aug 2011 at 3:20am
I have a crystal report that is showing me too many details.
 
I have it linked with a sub report. I only want it to show me data when the subreport is showing data.
 
In the section expert i should be able to write a formula to say if subreport (Sales Field)> then 0  then show details else suppress main report detail.
 
Does anyone know how to write a formula that will work with the subreport?
 
let me know
thanks
adam
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 24 Aug 2011 at 3:31am
question, is the subreport displayed before or after the details that you want to display?
 
if before, life isn't too bad.
put the subreport in it's own detail band, say detailA...even better it sounds like put in a group header band and create a shared variable in the subreport and assign it, probably, the sum of the Sales Field, unless it is just one line, then assign it the value of the field.... Like:
shared numbervar saleField := {table.salesField};
"" // hides the assignment.
 
in detail b or the detail section in the main report, conditionally suppress in Section Expert:
shared numbervar salesField;
salesField <= 0
 
Done.
 
If the subreport runs/displays after the detail, you will need to run the subreport twice, which makes a less then optimal solution even worse. 
 
Subreports hit the database once per time run, so running a subreport slows the overall execution of a report, so small reports may not notice a hit, but large reports would.
 
HTH
IP IP Logged
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Posted: 24 Aug 2011 at 3:45am
ok great...so are you saying create the formulas to suppress the details in the main report from the subreport?
 
Currently my report looks something  like this below:
 
Main Report                                                                SubRerport
ItemNum Sales SlsPerson                           ItemNum Return $ Sls Person
1234        100     Adam
1234        100     Adam
4321        200     Adam                                4321         -200        Adam
 
 
 
What I am trying to do is suppress the first 2 rows of data and only have it show when data is coming from the subreport.
 
I am going to try to figure out what you are telling me to do with the shared variable.
 
If you have any other suggestions let me know.
Thanks
 
 
IP IP Logged
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Posted: 24 Aug 2011 at 4:02am
also the main report and the subreport are based off 2 different data parameters which is why the subreport is needed.
 
so the sales fields are coming from 2 seperate tables.
IP IP Logged
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Posted: 24 Aug 2011 at 4:09am

2 different date parameters....sorry

 
 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.