Question Selection Formula and Boolean values??

gate7cy

Well-known member
Joined
May 11, 2009
Messages
119
Programming Experience
3-5
VB.NET:
I am developing a small application which requires a bit of reports. I use crystal reports together with vs/vb 2008 and access 2007 for the db. In my report I filter the data using a combobox and using in code the selection formula to get the needed results. This is what I do:

VB.NET:
CrystalReportViewer1.SelectionFormula = "{AllServices.Technicians} = 'james'"
            CrystalReportViewer1.RefreshReport()

When I use strings to filter like the above one no problem. When I try to filter data according to a column which stores boolean values of '0' and '-1' I get the weirdest error message. Here it is:

A boolean is required here.
Error in File
C:\Users\KORNHO~1\AppData\Local\Temp\temp_e03b07bf-5711-4899-8a7d-2bf7312d5a3b
{CDE41268-7151-4C31-AECA-BB6A47341221}.rpt:
Error in formula <Record_Selection>.
'{AllServices.Completed} = '0''
A boolean is required here.

This is the code I use when I get this:

VB.NET:
       CrystalReportViewer1.SelectionFormula = "{AllServices.Completed} = '-1'"
        CrystalReportViewer1.RefreshReport()


It says that a boolean is needed here and a boolean I am using. I have google it, forumed it, read about it but nothing to assist me. Anyone has any hints on what is going wrong? Thanks for the replies
 
Back
Top