Saturday, 30 July 2016

Filtering Data On SSRS Query

Below is the sample code written to filter the data based on Query used by report and apply on custom query in DP class;

//DP class
//Get filtered/selected value from standard query
qrOrderAccount = queryVendInvoiceJour.dataSourceName(‘VendInvoiceJour’).rangeField(fieldNum(VendInvoiceJour,OrderAccount));
//Writing custom query based on requirement but applying the selected ranges to custom query
q=new Query();
qbdsVendInvoiceJour = q.addDataSource(tablenum(VendTrans));
qrVendInvoiceJour = qbdsVendInvoiceJour.addRange(fieldNum(VendTrans,AccountNum));
qr = new QueryRun(q);

This will help to overwrite the Query used in Report using the custom query by applying same ranges selected by user.

No comments:

Post a Comment

Excel data connector in AX7/D365

Excel data connector in AX7: Configuring and using the Excel Data Connector Add-in The Excel Data Connector add-in is built by usi...