Set date range to datasource in report fetch method using Dynamics Ax
querybuildrange qbr;
QueryRun qr = new queryrun(this.query());
;
qbr = qr.query().datasourcetable(tablenum(Inventtrans)).addrange(fieldnum(Inventtrans,DatePhysical));
qbr.value(queryrange(From_Date,To_Date));
element.send(Inventtrans);
element.send(Test_1);
querybuildrange qbr;
QueryRun qr = new queryrun(this.query());
;
qbr = qr.query().datasourcetable(tablenum(Inventtrans)).addrange(fieldnum(Inventtrans,DatePhysical));
qbr.value(queryrange(From_Date,To_Date));
element.send(Inventtrans);
element.send(Test_1);