I want to create a report according to monthwise in AX 2009

Hi, I am working in AX 2009. My clients wants an urgent requirement. He enter ‘from date’ and ‘to date’ in a dialog or query. I need to get a report according to monthwise the no. of transactionsids in Sales Order. Please help me how can i do this.

i have recently come across this scenario, but it was in ax 2012 ssrs reports.

i am not good in ax 2009 reports , but anyway I will give you the suggestion.

we can solve this by using a switch case .

1)Pass from date and todate to date fields.

2)find out the month of that particular year by using the function mthofyr

eg: switch (mthOfYr(from date))

{

case 4://April

break;

case 5://May

break;

case 6://June

;

break;

case 7://July

break;

case 8://August

break;

case 9://Secptember

break;

case 10://October

break;

case 11://November

break;

case 12://December

break;

case 1://Januray

break;

case 2://February

break;

case 3://March

break;

}

  1. if you follow the above said logic you can retrive the records on month wise basis.

hi,

Did you find the solution for this scenario…?
i also have the requirement… pls help me in the same

You can use DatemthFwd, DatestartMth, DateEndMth functions.

Dear Mr. Saji
Can you please explain me in detail… i didnt get you

static void Job68(Args _args)
{
FromDate fromdate = mkDate(2, 3, 2016);
ToDate todate = mkDate(10, 11, 2016);
int startmonth = mthOfYr(fromdate);
int endmonth = mthOfYr(todate);

while (startmonth <= endmonth)
{
fromdate = dateStartMth(fromdate);
todate = dateEndMth(fromdate);

// your logic here

fromdate = dateMthFwd(fromdate, 1);
startmonth++;

}

}

This is the sample code. Just check this. you will get some idea.

yeah i got some idea thanks for your reply… and am i want to write this logic in my fetch method?

Yes, You need to write the logic in fetch method(AX 2009). For AX2012 - Processreport in DP class.

yeah thanks saju… let me try

Regards,
Ameen