web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to add a new parameter to ssrs report by extending the data contract and get the value in dp class extension?

(0) ShareShare
ReportReport
Posted on by 100

Hi all, I need to add two new parameters to the standard report dialog and use the values in dp class to filter the records. The report only uses a contract class and no ui builder class, so I have taken the extension of the contract class and added the parm methods. These new fields are showing correctly in the dialog when I call the report. But when I try to fetch the values I selected in the Dialog in DP class they are blank. Can some one help me with what I am missing, here is my code. Any thoughts will be really helpful and thanks in advance

[ExtensionOf(classStr(PSAPayWhenPaidContract))]
[
    DataContractAttribute]
/// <summary>
/// When Form is open,
/// Set the status as OPEN and mark the Pwp checkbox as Yes.
/// </summary>
public final class PSAPayWhenPaidContract_Extension
{
    public NoYes                  pwp;
    public PSAVendInvoiceStatus   invoiceStatus;

    [DataMemberAttribute("PayWhenPaid"),
        SysOperationLabelAttribute(literalstr("@PSA3342"))]
    public NoYes parmPayWhenPaid(NoYes _pwp = pwp)
    {
        pwp = _pwp;
        return pwp;
    }

    [DataMemberAttribute("InvoiceStatus"),
        SysOperationLabelAttribute(literalStr("@PSA125"))]
        public PSAVendInvoiceStatus parmInvoiceStatus(PSAVendInvoiceStatus _invoiceStatus = invoiceStatus)
    {
        invoiceStatus = _invoiceStatus;
        return invoiceStatus;
        
    }

}

Here is how I am calling in the DP class

public void processReport()
    {
        QueryRun            QueryRun;
        CustTrans           custTrans;
        ProjCostTrans       projCostTrans;
        ProjInvoiceCost     projInvoiceCost;

        

        next processReport();

        PSAPayWhenPaidContract contractLoc                        =   this.parmDataContract() as PSAPayWhenPaidContract;
        NoYes isPwpLoc2 = contractLoc.parmPayWhenPaid();
        PSAVendInvoiceStatus pSAVendInvoiceStatusLoc2 = contractLoc.parmInvoiceStatus();

        NoYes isPwpLoc = contract.parmPayWhenPaid();
        PSAVendInvoiceStatus pSAVendInvoiceStatusLoc = contract.parmInvoiceStatus();

}

I have the same question (0)
  • Suggested answer
    huijij Profile Picture
    19,811 on at

    Hi,

    Is the contract variable you used in the  processReport() method missing it's definition?

    PSAPayWhenPaidContract_Extension Constract;
    Constract = this.parmDataContract();

  • Suggested answer
    Alex VN Profile Picture
    1,994 on at

    Hi Judy,

    Regarding this issue, one thing I'm concerned is that when you add the contract parameter, normally you might need to restore the related datasource on the report in order for the parameters being added to report Parameters. This seems to be a bug or a limit of VS report implementation for D365FO.

    Unfortunately I think we can not restore DS on the standard report so it might not work. So I think you might need to duplicate the standard report, add your contract param and then restore on DS. You might need to redirect all the call to the duplicated report as well.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 663 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 289 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans