Question

am using devexpress winforms reports, I can able to set one filterString condition in code, this code is working successful

report.FilterString = "CompanyId =" + compid; 

and

DetailReport.FilterString = "CompanyId=" + compid; 

But now I need to set for two conditions I tried this code but it didn't filter display all values.

report.FilterString = "[CompanyId = " + compid +"] AND [ InvoiceStatus =" + status + "]";

Help me how to solve this ?

Was it helpful?

Solution 2

Thanks to all. Finally solved by this code and working fine for two filters using correct string formats.

report.FilterString = "InvoiceStatus = '" + status + "' AND CompanyId = " + compid;

OTHER TIPS

The simplest filter syntax looks like this: "[FieldName] = Value".

Thus, change your code as follows:

report.FilterString = string.Format("[CompanyId] = {0} AND [InvoiceStatus] = {1}", compid, status);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top