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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

SSRS report hide dialog and set parameters

(0) ShareShare
ReportReport
Posted on by 577

I cannot hide the dialog using parmShowDialog(false);

class MyPackingListController extends SrsReportRunController
{
    
    public static client void main(Args args)
    {
        //define the new object for controller class
        MyPackingListController packingListController = new MyPackingListController();

        //pass the caller args to the controller
        packingListController.parmArgs(args);

        //set the report name and report design to run
        packingListController.parmReportName(ssrsReportStr(MyPackingList, Report));

        //hide the report parameter dialog
        packingListController.parmShowDialog(false);
        
        //execute the report
        packingListController.startOperation();
    }

Also, I cannot show the record id in the ssrs report. I set the record id using preRunModifyContract() in controller and get value in processreport() in RDP class

class MyPackingListController extends SrsReportRunController
{
    protected void preRunModifyContract()
    {
        //define object for report contract
        MyPackingListContract contract;

        //get the reference of the current contract object
        contract = this.parmReportContract().parmRdpContract() as MyPackingListContract;

        //set journal record id
        if(this.parmArgs() && this.parmArgs().callerName() == "MyPackingListJour")
        {
            FormRun _FormRun = this.parmArgs().caller();
            MyPackingListJour packingListJour = _FormRun.dataSource("MyPackingListJour").cursor();

            contract.parmRecordId(packingListJour.RecId);

            Info(strFmt("contract.parmRecordId() %1",contract.parmRecordId()));
        }
        
    }
}

[SRSReportParameterAttribute(classStr(MyPackingListContract))]
class MyPackingListDP extends SRSReportDataProviderBase
{
    public void processReport()
    {
        //clear the temporary tables
        packingListHeaderTmp.clear();
        packingListDetailsTmp.clear();

        MyPackingListContract contract = this.parmDataContract() as MyPackingListContract;
        
        //packingListDetailsTmp.ItemId = "1111";
        packingListDetailsTmp.ItemId = strFmt("%1",contract.parmRecordId());

        packingListDetailsTmp.insert();
    }
}

The contract is for reference.

[DataContractAttribute]
class MyPackingListContract
{
    RecId                               recordId;

    [DataMemberAttribute('RecordId')]
    public recId parmRecordId(recId _recordId = recordId)
    {
        recordId = _recordId;
        return recordId;
    }

}

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Is your issue related to AX2009/AX2012 or D365FO?

    Can you share your system version details?

    Many thanks and best regards,

    Ludwig

  • Tony Mok Profile Picture
    577 on at

    I cannot hide the dialog using parmShowDialog(false);

    class MyPackingListController extends SrsReportRunController
    {
        
        public static client void main(Args args)
        {
            //define the new object for controller class
            MyPackingListController packingListController = new MyPackingListController();
    
            //pass the caller args to the controller
            packingListController.parmArgs(args);
    
            //set the report name and report design to run
            packingListController.parmReportName(ssrsReportStr(MyPackingList, Report));
    
            //hide the report parameter dialog
            packingListController.parmShowDialog(false);
            
            //execute the report
            packingListController.startOperation();
        }
    

    Also, I cannot show the record id in the ssrs report. I set the record id using preRunModifyContract() in controller and get value in processreport() in RDP class

    class MyPackingListController extends SrsReportRunController
    {
        protected void preRunModifyContract()
        {
            //define object for report contract
            MyPackingListContract contract;
    
            //get the reference of the current contract object
            contract = this.parmReportContract().parmRdpContract() as MyPackingListContract;
    
            //set journal record id
            if(this.parmArgs() && this.parmArgs().callerName() == "MyPackingListJour")
            {
                FormRun _FormRun = this.parmArgs().caller();
                MyPackingListJour packingListJour = _FormRun.dataSource("MyPackingListJour").cursor();
    
                contract.parmRecordId(packingListJour.RecId);
    
                Info(strFmt("contract.parmRecordId() %1",contract.parmRecordId()));
            }
            
        }
    }

    [SRSReportParameterAttribute(classStr(MyPackingListContract))]
    class MyPackingListDP extends SRSReportDataProviderBase
    {
        public void processReport()
        {
            //clear the temporary tables
            packingListHeaderTmp.clear();
            packingListDetailsTmp.clear();
    
            MyPackingListContract contract = this.parmDataContract() as MyPackingListContract;
            
            //packingListDetailsTmp.ItemId = "1111";
            packingListDetailsTmp.ItemId = strFmt("%1",contract.parmRecordId());
    
            packingListDetailsTmp.insert();
        }
    }

    The contract is for reference.

    [DataContractAttribute]
    class MyPackingListContract
    {
        RecId                               recordId;
    
        [DataMemberAttribute('RecordId')]
        public recId parmRecordId(recId _recordId = recordId)
        {
            recordId = _recordId;
            return recordId;
        }
    
    }

  • zhifeng Profile Picture
    on at
  • MATTGUO Profile Picture
    22,349 Moderator on at

    Hi Tony,

    You can use atributte SysOperationControlVisibilityAttribute(false) on datacontract parameter method to hide a data contract field.

    [

     DataMemberAttribute('recId'),

     SysOperationControlVisibilityAttribute(false)

    ]

    public RecId parmrecId(RecId _recId = recId)

    {

     recId = _recId;

     return recId;

    }

    Merged two threads.

  • Tony Mok Profile Picture
    577 on at

    Ludwig Reinhard, it is d365

  • Tony Mok Profile Picture
    577 on at

    MATTGUO, I tried and the record id is shown and I cannot show the record id in the report.

  • Verified answer
    Tony Mok Profile Picture
    577 on at

    MATTGUO, I reset the usage data and the dialog is hidden. I think the cache problem.

  • Tony Mok Profile Picture
    577 on at

    For the get value problem, please refer to community.dynamics.com/.../get-parameter-from-contract-class-to-dp-class

    I restore the dataset and redeploy the report

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans