SSRS Report bases on LookUp filteration

Hi guys i need a SSRS Report based on lookUp filteration. When i click the menuitem the lookUp will be displayed it contains the salesId when i select the corresponding sales id in the lookup field based on that the SSRS Report will generate…Thats my Scenario…

Now i have some doubt that in my case the lookup field is displayed with SalesId field …when i click that field it shows following error…can u please fix that…All my Dp class code are attached below…



class SRCustomLookuppDP extends SRSReportDataProviderBase

SRCustomLookUpContract contract;
TempTable tempTable;

public TempTable getTempTable()
select * from tempTable;

return tempTable;

public void insertInToTempTable(AccountNum _accountNum)



public void processReport()
Query query;
QueryRun qRun;
QueryBuildRange qbr;
// CustTable custTable;
CustInvoiceJour custinvoiceJour;

contract = this.parmDataContract() as SRCustomLookUpContract;
query = this.parmQuery();

qbr = query.dataSourceNo(1).addRange(fieldNum(CustInvoiceJour,SalesId));

qRun = new QueryRun(query);

CustInvoiceJour = qRun.get(tableNum(CustInvoiceJour));

Query object not initialized.

Stack trace

(S)\Classes\SRCustomLookuppDP\processReport - line 13
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59

(S)\Classes\Info\add - line 94
(S)\Classes\SRCustomLookuppDP\processReport - line 13
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59

did you check if you have a query?

I supose your error is here.

qbr = query.dataSourceNo(1).addRange(fieldNum(CustInvoiceJour,SalesId));

Do you have a query in your contract class?

There is No Query XBB

if don’t exist a query

query = this.parmQuery(); <–that’s return a null

qbr = query.dataSourceNo(1).addRange(fieldNum(CustInvoiceJour,SalesId)); <–and here throw error because don’t exist dataSource

try it!

QueryBuildDataSource qbds;

query = new Query();
qbds = query.adddatasource(tablenum(CustInvoiceJour));

qRun = new QueryRun(query);


thank u … XBB u clear my errror…

XBB when i click ok on dialog it generate the report as fully ‘0’…doesnot print sales id??


Did you check if you come into while ( ?

yeah XBB it will come and insert also while debugging…but when it run its shows noly ‘0’

if you have values on tmp table maybe the problem is on the report.

this.query() returns a query object if your data provider class was associated with a query, which it isn’t, so there is nothing to return. You can use SRSReportQueryAttribute for that, if required
If your RDP class correctly fills the data in, it seems that the problem is in how you display the data in the report.

[tag:martin] want to change any code modification??please help me

what shall i do#XBB…any code modification help me…please

Dear billgates, I can’t tell you what change to do if you don’t tell what you want to achieve and what problem you have with it. I can’t read your mind.

If you want a query as a data contract for your report (so users can modify ranges in the report dialog etc.), follow my previous reply. Ask a question if needed (something more specific than “want to change any code modification?”).
Nevertheless it seemed that you were happy with creating a new query in code, so then you wouldn’t need anything else.

hi martin,
let me tell you clearly what i want… when i click the salesId .Based on the SalesId all the fieds in the CustInvoiceJour Table Should be print in the SSRS report. How can i write the Code in DP class…or how can i write the Query ???

The simplest way is to create a query-based report. The query will have a single table, CustInvoiceJour - just create a new query and drag the table there. Done in a few seconds. Then add a range for SalesId (without any value). And that’s it. Then just create a report and use the query there.

Again, don’t forget that SalesId isn’t a unique identification of CustInvoiceJour. Using it looks like a bug in the functional design.

If you want to use an RDP report, you can either use a query there as well (then you’ll get it from this.query(), as explained above), or to use a contract class for and build the query in code. The first approach has the advantage that users can add more filters as needed.

Don’t forget that AX has documentation - if you don’t know how to create a query, for example, you can study it there.

But if i Pass a Querry in RDP class…when the dialog box is open the CustInvoiceJour Table is occur

I’m sorry, but I don’t understand what you’re saying. What does “the CustInvoiceJour Table is occur” mean? What’s the problem?
Don’t be shy using multiple sentences, examples and so on. I shouldn’t have to interrogate you - you want us to help you, so you have to do your piece and explain your problem.

hi martin,
sorry for my trouble,can you send me the code for RDP Class …

How do you expect me to write without telling me what it should do? There is no universal answer answering all questions and no universal code implementing all possible requirements.
And wouldn’t be better to learn how to write the code by yourself?
I’m willing to help you (as you can see from the fact that I haven’t left this thread yet), but there is little I can do without your cooperation.

Once more: could you please explain your problem? I seriously have no idea what “when the dialog box is open the CustInvoiceJour Table is occur” means.

If you don’t know what you’re trying to achieve and where you problem lies, have a break and think about it. Don’t try to write code without understanding what it should do. When you know what you’re trying to achieve, it’s much easier to actually do it.