Skip to main content



No record found.

Microsoft Dynamics AX forum
Suggested answer

SSRS report error - Parameter doesn't get passed

Posted on by 524

Hi Experts,

I have created a custom SSRS report which needs to be printed from a form i.e.. the argument should pass to the report from the form. The report does not work and gives me the error while trying to generate, A value must be provided for the parameter Load Id. I will provide my code here, can anyone help me to find out if i missed something or what is the issue with the code please. Load id is my parameter for the report. 

Contract class:- 


public class SalesLoadPackingSlipContract


    WHSLoadId   LoadId;



        DataMemberAttribute('Load Id'),

        SysOperationLabelAttribute(literalStr(/Load Id/)),




    public WHSLoadId parmLoadId(WHSLoadId _LoadId = LoadId)


        LoadId = _LoadId;

        return  LoadId;




Controller class:- 

class SalesLoadPackingSlipController extends SrsReportRunController
    public static void main(Args _args)
        SalesLoadPackingSlipController    controller = new SalesLoadPackingSlipController();
        WHSLoadTable wHSLoadTable;
        wHSLoadTable = _args.record() as wHSLoadTable;
        controller.parmReportName(ssrsReportStr(SLoadPackingSlip, Common));
DP Class:-
class SalesLoadPackingSlipDP extends SRSReportDataProviderBase  //SrsReportDataProviderPreProcess //
    //contract Class
    SalesLoadPackingSlipContract  salesLoadPackingSlipContract;
    //Temporary Tables to get report Data
    LoadPackingSlipHeaderTmp   loadPackingSlipHeaderTmp;
    LoadPackingSlipLineTmp     loadPackingSlipLineTmp;
    //Data Tables
    CompanyInfo            companyInfo;
    CustPackingSlipJour    custPackingSlipJour;
    CustPackingSlipTrans   custPackingSlipTrans;
    WHSLoadTableCustPackingSlipJour wHSLoadTableCustPackingSlipJour;
    //Report Parameter value
    WHSLoadId       LoadId;
    public LoadPackingSlipHeaderTmp getLoadPackingSlipHeaderTmp()
        select loadPackingSlipHeaderTmp;
        return loadPackingSlipHeaderTmp;
    public LoadPackingSlipLineTmp getLoadPackingSlipLineTmp()
        select loadPackingSlipLineTmp;
        return loadPackingSlipLineTmp;
    private void getReportParameters()
        salesLoadPackingSlipContract contract = this.parmDataContract();
        if (contract)
            LoadId   = contract.parmLoadId();
    public void processReport()
        //to fetch report parameters
        companyInfo = CompanyInfo::find();
        CustTable       CustTable;
        WHSLoadLine     whsLoadLine;
        salesLoadPackingSlipContract = this.parmDataContract() as salesLoadPackingSlipContract;
            loadPackingSlipHeaderTmp.LoadId = LoadId;  // Added just one line for testing purpose
  • Martin Dráb Profile Picture
    Martin Dráb 225,490 Super User on at
    SSRS report error - Parameter doesn't get passed
    I see you set wHSLoadTable in main(), but you never pass it to the contract class. You'd need to do something like this:
    SalesLoadPackingSlipContract contract = this.parmReportContract().parmRdpContract() as SalesLoadPackingSlipContract;
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 7,209 User Group Leader on at
    SSRS report error - Parameter doesn't get passed
    Hi @Alex,
    this problem has occurred when the parameter in report does not accept nullable or empty value.
    so you must go to the report and select the parameter and set :
    Allow blank true and nullable true.
    Best regards,
    Mohamed Amine MAHMOUDI

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans