Hi all,

I have a form Spares Entries which is called from Quotation table. 
Spares Entries form having datasources of Spares Header and Spares 
Line tables. Spares Header is having a field QuotationId. 

>From Spares Entries form i want print a report (which I have created) 
by clicking a button. I am calling the MenuItem of the report. 

My problem is the report doesn't filter the record which i want to 
pass. 

I tried following 2 methods to filter

Method 1 :
---------
On form init() method 

I have the following code :

public void init()
{
    SparesHeader spHeader;
    ;

    super();
    spHeader = element.args().record();
    Qid = spHeader.QuotationID;

    element.query().dataSourceTable(tablenum(SparesHeader)).addRange 
(fieldnum(SparesHeader, QuotationID)).value(Qid);
}

 

Method 2 :
----------
On form init() method 

I have the following code :

public void init()
{
    SparesHeader spHeader;
    Query q;
    QueryRun qr;
    QueryBuildDataSource qbd;
    QueryBuildRange qbr;
    ;

    super();
    spHeader = element.args().record();
    Qid = spHeader.QuotationID;

    q = new Query();
    qbd = q.addDataSource(TableNum(SparesHeader));
    qbr = qbd.addRange(FieldNum(SparesHeader, QuotationID));
    qbr.value(Qid);
    qr = new QueryRun(q);
}


Can anyone help me what's wrong in this code Or whats the correct 
procedure to filter record ?

Thanks

Murugan





Reply via email to