Hello Friends Help Me On This Issue

Hi Friends

I am Facing one issue with last 5 days pls help me and the issue is i have designed one Query based new SSRSreport and i want to access that report from " ItemForecast Form "(path oh the form is mentioned below),for this i have created one menuitem button and kept my report in that menuitem button, when iam clicking on that button first the parameter window is opening when iam selecting the ProjID(i have given ProjId as parameter in the Query level)report working fine but the requirement is from the form i am selecting one record and clicking on that menuitem button (in that record we have ProjId field) i want this projid in the report parameter and corresponding that projid i wants to generate the report.

In the below screenshot the 3rd field in the form is ProjId

PATH:: AX2012 > Project management and accounting > Inquiries > ForeCast > ItemForeCast > ActionPane > internal Reports > precalculation(this is our report).

Your Suggestions are really appreciable

Regards,

pawan

I don’t fully understand what you want, but if you want the ProjID to be automatically inserted as the Parameter on the report, you can use a Controller class and use the prePromptModifyContract method.

If that’s what you want and you need further help, just tell me.

Thans for your reply ANONX

i want that Projid in the parameter as per we select the record in the form.have alook on the screen shot below

Thank you

Hai Anonx

I have created preprompt modified method in controller class and when i compile the class the class it is not showing any error but when i run the report fron ForecastSales form after select the record and clicking on the menu item button it is showing an error below

Error:

Map object not initialized.

Stack trace

(C)\Classes\DRV_OrderdateviaforecastController\prePromptModifyContract - line 3
(C)\Classes\SrsReportRunController\startOperation - line 7
(C)\Classes\DRV_OrderdateviaforecastController\main - line 7
(C)\Classes\FormFunctionButtonControl\Clicked

Please help me on the issue

Thank You

Pawan

How does your class look like?

Just to be sure, I’ll show you a step by step

  1. You create a class which extends from SrsReportRunController. Then you define a macro with the report name and the Data Contract class.

class forecastController extends SrsReportRunController
{
#define.ReportName(“Report.DesignName”)
forecastContract dataContract;
}

  1. Next you create a main method

public static client void main(args _args)
{
forecastController controller = new forecastController();

controller.parmReportName(#ReportName);
controller.parmArgs(_args);
controller.startOperation();
}

  1. Now you override the prePromptModifyContract method

protected void prePromptModifyContract()
{
args Args;

super();

Args = this.parmArgs();

dataContract = this.parmReportContract().parmRdpContract();
dataContract.parmProjid(Args.record().(fieldnum(forecastTable, Projid)));
}

  1. Then you create a Menu Item and choose the Controller class as the object

  2. On the form you create a new Menut Item button and set the property “CopyCallerQuery” to “Yes”. Then you choose the created Menu Item as the MenuItemName for the button.

That should make it work then.

Hi pavan,

If u need a projid parameter in ur report, u need to include ur parameter in VS as Databound value.

There u can fetch ur projid as parameter. After u can re deploy to ur client.

Regards,

Zahir

Hi,

Refer below path.

http://community.dynamics.com/product/ax/f/33/p/97915/185451.aspx