Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Choice to pass subreport data to main report Post Reply Post New Topic
Author Message
chudok
Groupie
Groupie


Joined: 18 May 2010
Online Status: Offline
Posts: 70
Quote chudok Replybullet Topic: Choice to pass subreport data to main report
     Posted: 18 Oct 2010 at 4:45am

I am buidling a report that will have several subreports.  Each subreport will be linked by a branch # in a parameter mto the main report.  Which works fine.  What I am trying to do is have the user have the choice if they want to see each subreports or not. 

It would work like this: This is survey so each subreport has details such as state, age of purchaser, items purchased etc.....  I want the user to be able to say they want to see the state detail, and that get passed onto main report. I do not want the user to have to pick each state they want to see.  I want the user to be able to pick a drop down choice to add the subreport.  I want the whole sub report to be passed using the parameter of the branch. 
Can this be done?
 
***ADDED NOTES***
I guess another way to look at this is seperate grouping.  I can use 1 report - group on branch, but then I want the details for each section below to stay together.  But I still want to give the choice for the user to determine if they want to see that section or not.


Edited by chudok - 18 Oct 2010 at 6:55am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Oct 2010 at 3:26am
somehow, they are going to need to enter a value, either a list of things to keep or to exclude.  It can be delimited, so you might say list the states, and another option to be included or excluded.
 
so you might get list like az, ca, tx  as long as you know the delimiter, or the items are unique, you can put that in the record selection criteria, along with the include/exclude flag. 
 
Something like:
 
if @include then
  (instr(@list, {table.field}) > 0)  //is true if in the list
else
  not (instr(@list, {table.field} > 0)   //return false if in the list
 
HTH
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