Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Selecting data based on True/False columns Post Reply Post New Topic
Author Message
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Topic: Selecting data based on True/False columns
     Posted: 04 Nov 2014 at 5:18am
I am using CR XI r2.

I have created an SQL database for my users into which they enter chemical MSDS data.  There are various governmental reporting requirements that may or may not be required for each chemical.  I have set up an entry screen in MS Access to allow them to enter the chemical details and select which reporting requirements apply to that chemical.  The reporting requirements are check boxes which result in a 'True' entry in that specific column in the database if the box is checked; otherwise the default is 'False'.  Some chemicals may have more than one reporting requirement checked.  There are currently 16 different reporting requirements which may increase or decrease as government regulations change from year to year.

I now need to write a report to pull the chemicals based on which reporting requirement is checked.  I want a drop-down parameter of the 16 reporting requirements from which my users can select so that the report pulls only the chemicals which have 'True' for the selected reporting requirement.

How can I go about achieving this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2014 at 6:26am
So you want one multi-select param rather than 16 distinct params to choose t/f from?
also if they select 3 options do you want it to return anything where the 3 options=T or anything where the 3 options=T and the other 13 options=F
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 05 Nov 2014 at 7:24am
DBlank,

I want one drop-down list parameter from which the user can select one reporting requirement.  The report will then extract all chemicals from the database which have 'True' set for that single reporting requirement regardless of the T/F state of any of the other 15 requirements.

For example:
Chemical A requires reporting for FDA, OSHA, and CA Prop 65.
Chemical B requires reporting for CA Prop 65, Tier II and the Dudd-Skank Act.
Chemical C requires reporting for OSHA, and CA Prop 65.

The user wants to run the report to select ONLY the chemicals that require CA Prop 65 reporting.
Since the db has True/False for the values in the table for the individual reporting requirements, I am unsure how to give the users a drop-down list with the requirements and have CR know which column to look in for 'True' instances.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2014 at 7:41am
Make  Drop down with all of your reporting options and set it to a single select
Assuming you do not have NULLs to deal with, in your select use:
(?param = 'FDA' and table.fda)
or
(?param = 'OSHA' and table.OSHA)
or
(?param = 'CA Prop 65' and table.CA Prop 65)
or
...
 
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 05 Nov 2014 at 8:07am
DBlank,

That did the trick!  Thank you so much!
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