Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Bitwise Operator - HELP!!! Post Reply Post New Topic
Author Message
PHinett
Newbie
Newbie
Avatar

Joined: 08 Jul 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote PHinett Replybullet Topic: Bitwise Operator - HELP!!!
    Posted: 08 Jul 2008 at 6:45am
Hi,
 
Hope i can get some good help around here, this has been bugging me for days!!!
 
I'm fairly new to crystal reports, i've done some simple reports and stuff in the past but now i've come up with a little problem that i can't get past.
 
In my database i store a integer value representing a bit value called "Products".
 
products could be of 5 types and each has these values for example:
 
prod1 = 1
prod2 = 2
prod3 = 4
prod4 = 8
prod5 = 16
 
Normally in my ASP.Net application i can perform an action like this to find out what products have been selected:
 
If (userProducts AND PROD1)  then
 selProd = "Prod1, "
End If
 
If (userProducts AND PROD2)  then
 selProd &= "Prod2, "
End If
 
If (userProducts AND PROD3)  then
 selProd &= "Prod3, "
End If
 
Etc...
 
I have tried to do this in a crystal reports function but just can't seem to do it....can anybody help me out?
 
Thanks!!
Paul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 08 Jul 2008 at 7:35am
Hi,
 
Not sure what you looking for ,but if you need to assign value to selprod you need to use := if you need to compare use =
 
Also you will need to declare variable such as StringVar selprod;
 
hope that helps
 
 
IP IP Logged
PHinett
Newbie
Newbie
Avatar

Joined: 08 Jul 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote PHinett Replybullet Posted: 08 Jul 2008 at 7:44am
It's a method i use in asp.net to store multiple selections from a user into a single integer.  So if they selected prod1, prod3 and prod5 the integer value would be "21".
 
I can then use the if else functions above to determine what products was selected by the user.
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.