如何在D365FO创建SSRS报表(三)Contract Class(how-to-create-ssrs-report-in-d365fo-part3-contract-class)

Contract

存放报表打印时使用的参数

实现接口 SysOperationValidatable

[
    DataContractAttribute,
    SysOperationGroupAttribute('Parameters', "@SYS28007", '1'),
    SysOperationGroupAttribute('ViewGroup', "@SYS5252", '2')
]
public class Demo_InventJournalTransTransferContract implements SysOperationValidatable
{
    TransDate							fromDate,toDate;
    InventDimViewContract   InventDimViewContract;
 
 
    [
        DataMemberAttribute("From date"),
        SysOperationLabelAttribute(literalstr("From date")),
        SysOperationDisplayOrderAttribute('1')
    ]
    public TransDate parmFromDate(TransDate _fromDate = fromDate)
    {
        fromDate = _fromDate;
        return fromDate;
    }
 
    [
        DataMemberAttribute("To date"),
        SysOperationLabelAttribute(literalstr("To date")),
        SysOperationDisplayOrderAttribute('2')
    ]
    public TransDate parmToDate(TransDate _toDate = toDate)
    {
        toDate = _toDate;
        return toDate;
    }
 
    [
        DataMemberAttribute('InventDimViewContract')
    ]
    public InventDimViewContract parmInventDimViewContract(
        InventDimViewContract _inventDimViewContract = inventDimViewContract
        )
    {
        inventDimViewContract = _inventDimViewContract;
 
        return inventDimViewContract;
    }
 
    public boolean validate()
    {
        boolean isValid = true;
 
        return isValid;
    }
 
}