Skip to main content

Notifications

Announcements

No record found.

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();

}

  • Suggested answer
    Alex VN Profile Picture
    1,994 on at
    RE: How to add a new parameter to ssrs report by extending the data contract and get the value in dp class extension?

    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.

  • Suggested answer
    huijij Profile Picture
    19,811 on at
    RE: How to add a new parameter to ssrs report by extending the data contract and get the value in dp class extension?

    Hi,

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

    PSAPayWhenPaidContract_Extension Constract;
    Constract = this.parmDataContract();

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans