thnx Crispin John it worked. Here is the final solution.
[SysEntryPointAttribute(false)]
public void processReport()
{
Query query;
QueryRun queryrun;
QueryBuildRange daterange;
QueryBuildDataSource qbds;
ItemWiseSaleContract contract;
CustInvoiceJour custInvoiceJour;
CustInvoiceTrans custInvoiceTrans;
contract = this.parmDataContract() as ItemWiseSaleContract;
//query = this.parmQuery();
query = this.parmQuery();
qbds = query.dataSourceTable(tableNum(CustInvoiceJour));
daterange = SysQuery::findOrCreateRange(qbds, fieldNum(CustInvoiceJour,InvoiceDate));
daterange.value(SysQuery::range(contract.parmStartDate(), contract.parmEndDate()));
//qbds = query.addDataSource(tableNum(CustInvoiceJour));
//daterange = qbds.addRange(fieldNum(CustInvoiceJour,InvoiceDate));
// daterange = SysQuery::findOrCreateRange(qbds,fieldNum(CustInvoiceJour,InvoiceDate));
//daterange.value(strFmt('((InvoiceDate >= %1) && (InvoiceDate <= %2))', date2StrXpp(contract.parmStartDate()), date2StrXpp(contract.parmEndDate())));
queryrun = new QueryRun(query);
delete_from ItemWiseSaleTMP;
while(queryrun.next())
{
ItemWiseSaleTMP.clear();
custInvoiceJour = queryrun.get(tableNum(CustInvoiceJour));
custInvoiceTrans = queryrun.get(tableNum(CustInvoiceTrans));
ItemWiseSaleTMP.ItemId = CustInvoiceTrans.ItemId;
ItemWiseSaleTMP.ItemName = CustInvoiceTrans.Name;
ItemWiseSaleTMP.InvoiceDate = CustInvoiceJour.InvoiceDate;
ItemWiseSaleTMP.SalesId = CustInvoiceJour.SalesId;
ItemWiseSaleTMP.CustAccount = CustInvoicejour.InvoiceAccount;
ItemWiseSaleTMP.CustName = CustInvoiceJour.invoiceName();
ItemWiseSaleTMP.Qty = CustInvoiceTrans.Qty;
ItemWiseSaleTMP.Price = CustInvoiceTrans.SalesPrice;
ItemWiseSaleTMP.SalesUnit = CustInvoiceTrans.SalesUnit;
ItemWiseSaleTMP.Amount = CustInvoiceTrans.LineAmount;
ItemWiseSaleTMP.insert();
}
}