Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to check/mark list of items using array or variable

Status
Not open for further replies.

crystaldev1

Programmer
Nov 6, 2003
232
US
Hello. I'm using CR 9 and Sql Server 2005. I have a scenario where I need to check off list of items if they are stored. For ex, I have a list of items and checkbox next to the items such as

1. Orange []
2. Banana []
3. Apple []
4. Mango []

and if only Orange and Apple is in the database, then they should be checked. List of items will be in the report footer.

I would like to somehow check off only the items in the database. I believe I can either store the items as string variable or array and create a formula to check each items. I could create a subreport for each individual item but I could have more than 20 items which may not be ideal due to # of subreports. I would like to know the most efficient way to perform this. Thanks.
 
As you have suggested you can use Vars, but will need to know in advance all the types you have.

In detail add formula

@Checks
whileprintingrecords;

global booleanvar orange;
global booleanvar apple;
global booleanvar mango;

etc......


If {yourfield} = "orange" then orange:=true;
If {yourfield} = "apple" then apple:=true;
etc ....


In report footer you need a display formula for each var

@Displayorange
whileprintingrecords;

global booleanvar orange;

If orange = true then 'P' else '';

Place this formula in appropraite location and convert font to wingdings2 and if tru a tick will appear.

Ian




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top