How to filter the report data programmatically

Question Status

jianrui ding asked a question on 21 Jul 2014 6:05 PM

Hi There,

My report project artifacts as below:

1. one AOT query.

2. a custom report controller which extends the "SrsReportRunController".

3. SSRS report

4. A menu item which link to the SSRS report controller which i created above.

In order to filter the report data programmatically, i tried to figure it out by two approaches.

1. try to update the query range by use the controller.

i tried to override two methods as below:



in above methods, i tried to get the report query by call "this.getFirstQuery()", but always return null.

so i gave up. try to solution two.

2. try to assign the report parameter in the controller.

i defined the parameters on the report. and bound it to the report filter, override below methods



in the above methods, i tried to assign the value, but i got the error information as "the parameter xxxx does not exist".

the last approach is using the custom RDP, (not try yet)  but i think above two solution should work as well, right ?

many thanks.

Martin Dráb responded on 22 Jul 2014 3:30 PM

Does your report get data from the query without issues?

If so, I can't think about anything that can cause the problem. You could debug getFirstQuery() to see whether the whole query contract map is empty, or something fails when retrieving an individual contract.

Baber Owais responded on 22 Jul 2014 5:44 PM

Try using the below code to retrieve the report query in prePromptModifyContract method:


You can find the example of this in HcmAccomodationListController class.

Please let me know if it does not resolve issue.

jianrui ding responded on 22 Jul 2014 7:45 PM

It's pretty tricky that i create a new query which has the same data source, and a new report link to the query. i use the same controller to open the report and i can get the query now, they are almost the same.

even though the report can work now, but i'm still confused why the first one cannot work.