Ax 2009 report in SSRS


I would like to write complex query for my report. I have always made reports in T-SQL using tmp tables. Now I have to write some report in AX 2009.

I usually fill tmp table using few queries and show data from tmp table. I know in AX is many way to do something. I think that I should write the x++ class with query and later call class in data method in report and bind it to datasests…
Is this good way?