Skip to main content

Posts

Showing posts with the label querybuilddatasource in rpt

Use temporary variable to distinct or group by element to fetch record in Axapta

Fetch method is override method of report in axapta. You can Use temporary variable to distinct or group by element to fetch record in Axapta . By this example you can get only hints or idea to use in your report. public boolean fetch() { Query q = new Query(); QueryBuildDataSource qbds; ; q= this.query(); qbds = q.dataSourceTable(tablenum(LedgerTrans)); // qbds = q.addDataSource() qbds.addSortField(fieldnum(LedgerTrans,AccountNum)); rangeTransDate =qbds.findRange(fieldnum(LedgerTrans,TransDate)); purpose1 = qbds.findRange(FieldId2Ext(FieldNum(LedgerTrans, Dimension),3)); if(!rangeTransDate.value()) { rangeTransDate.value(queryRange(dateMin,dateMax)); fromdate= dateMin; todate =dateMax; } else { value=rangeTransDate.value(); if(strfind(value,".",1,11) != 0) { mindate1 =strdel(value,strfind(value,".",1,11),strlen(value)); maxdate1 =strDel(value,strfind(value,".",1,11)+1,-(strfind(val