Monday, 3 September 2012

Performing Manual Filter on the forms


Performing Manual Filter on  the forms
Step 1: Declare a QueryBuildRange instance variable in the class declaration

public class FormRun extends ObjectRun
{
        QueryBuildRange qbr;
}

Step 2: Write the following code in the data source init() method
public void init()
{
          super();
          qbr=this.query().dataSourceNo(1).addRange(fieldNum(CDetails,Gender));
}

Step 3:Write the  following code in the  method of executeQuery() of data source

public void executeQuery()
{
    str value;
    if((Combobox.valueStr())==(enum2str(Gender::All)))
    {
        value="";
    }
    else
    {
        value=Combobox.valueStr();
    }
    qbr.value(value);

     super();
}

Step 4: Write the  following code in the  method of Combobox SelectionChange() Method of
        public int selectionChange()
{
          int ret;

         ret = super();
        CDetails_ds.executeQuery();
        return ret;
}

No comments:

Post a Comment