Automatically fill parameter of SSRS Report with Selected Data in AX

I have made a RDP SSRS Report of a Journal Voucher, that has a Journal Number Parameter.

It is working properly, but I need to add a feature that automatically fills the parameter upon selecting the Journal Number in AX (General Journal Form)

ex.

select Journal Number (ABC-00001) > Print > Voucher

the SSRS Report should have filtered the Journal Number and the output comes out with ABC-00001 data.

can someone put in a code or something for reference?

Thanks.

you have to use the controller class for selected record printing see the below link for clarification

http://www.dynamics101.com/2014/01/using-controller-class-developing-ssrs-reports-microsoft-dynamics-ax-2012/

Hello Xspy,

Already same thing we have in AX

Example:

@ Project management and accounting / Journal / Hour

Click on any Hour Journal > Print

Below Query range is passed @ ProjJournalTransController.setRanges()

1121.Untitled.png

Dear XSpy,

You need to pass these values from the controller class to the contract class, please check the Purchase requisition report classes PurchReqContract, PurchReqController and how it’s passes the RecId and RequisitionPurpose from the Controller to the contract.

Contract class:

[DataMemberAttribute(‘RequisitionPurpose’)]

public RequisitionPurpose parmRequisitionPurpose(RequisitionPurpose _requisitionPurpose = requisitionPurpose)

{

requisitionPurpose = _requisitionPurpose;

return requisitionPurpose;

}

Controller class:

protected void preRunModifyContract()

{

PurchReqContract contract;

PurchReqTableVersion purchReqTableVersion;

if(!this.parmArgs().record())

{

throw error("@SYS26348");

}

else

{

purchReqTableVersion = this.parmArgs().record();

}

if (purchReqTableVersion)

{

contract = this.parmReportContract().parmRdpContract() as PurchReqContract;

if (contract)

{

contract.parmRecordId(purchReqTableVersion.RecId);

contract.parmVersioningTimeStamp(purchReqTableVersion.VersionDateTime);

contract.parmRequisitionPurpose(purchReqTableVersion.RequisitionPurpose());

}

}

}

Regards,

Ahmad Al-Saify