Calling SQL SP from AX

I want develop a report in AX… see below the report format
Item Catagory Today Actual Sales Today Budgeted Sales Last year this day sales so many calculated fields…

01 $120 $160 $90
02 $300 $350 $200
03 $900 $650 $500

same thing I have to prepare for Year to Date and Month to Date…

I dont know which way we can do this report… I am planning to write a SP and store the values in a temp table… use that table in AX for reporting… is it possible to call sp inclucding parameter from AX?

Please give your valuable suggestion…

Regards

Dhamu

You could use the Report Builder to call the stored procedure (with parameters) and then create a menu in AX to call the SSRS report. Otherwise, you could override the fetch method of the AX report and use SqlConnection or an OdbcConnection to call the stored procedure with parameters and then loop through the resulting recordset.