jeudi 19 juillet 2012

Easy way of adding Parameter fields , ordering and grouping them from Contract Class on to SSRS report [Dynamics AX 2012]


Friends,
We all know that RDP[Report data provider] class in AX 2012,  is an X++ class that is used to access and process data for a Reporting Services report on a dataset.
And we have also seen that Contract classes will help to add parameters to any report. In this post, I will quickly walk through how to add parameters and display in the order you would like to see and group them under a group name.
Let me explain with a standard example : Human Resources >> Reports >> Worker resume
Contract class in X++ : HcmWorkerResumeContract
If we open this report, we will see the parameters as shown below. 

image
Well, the answer is pretty simple:
All the parameters fields are coming from Parm methods from the contract class as shown below
image
Resume Content and Page Range groups are coming from the Group Attributes defined in the Contract class “Class declaration”
image
The parameter fields are added to the groups and the order is also mentioned in the contract parm methods as shown below
Consider parmPrintCertificate() method from the contract class:
SysOperationLabelAttribute will help to add label to parameter field
SysOperationHelpTextAttribute will provide the help text for the parameter field
SysOperationGroupMemberAttribute will help the parameter field to be added to the group “Resume content
SysOperationDisplayOrderAttribute will help to order the parameter field, In the below example the order is given as “7” , so you will see this parameter getting added as a 7th field in order in the Resume content Group.
Picture explains below:
image
That’s it for now.
Happy Dax6ng,
Sreenath Reddy

Aucun commentaire:

Enregistrer un commentaire