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 :
Microsoft Dynamics AX (Archived)

How to pass report design values to Simple dialog box?

(0) ShareShare
ReportReport
Posted on by 1,883

Dear all,

I have 3 report designs say report1, report2 , report3 and I wants display like drop down option to end user so he could select one report design before confirmation of any report. Just I wants to know how to pass 3 report designs for a simple dialog box?

static void outputReport(Args _args)
{
dialog              dialog;
dialogGroup    dialogGroup;
dialogField      dialogField;
;
dialog              = new Dialog("Simple Dialog");
dialogGroup    = dialog.addGroup("Select your Choice");
//dialogField      = dialog.addField(extendedTypeStr(custAccount));
if (dialog.run())
{
print dialogField.value();
pause;
}
}

 

Best Regards,

Faqru Shaik

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Create a Base Enum with enum elements as per your report designs. Then add that dialog field for the enum. Then when you run the report, you could write custom logic to select a specific design mapped against your enum value selected before.

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi,

    you can also get list of all designs of a report and then you can add results to a temp table. finally you can present a lookup from that temp table.

    TreeNode                designsNode;
        ResourceNode            designNode;
        SSRSReportConceptNode   reportNode;
        TreeNodeIterator        designNodeIterator;
        TmpSrsReportDesignName  tmpDesignNames = null;    
        SRSReportName reportName = 'FreeTextInvoice'; // you can put here your report name
        
        
        #AOT
        #SRSFramework
    
        if (reportName)
        {
            reportNode = TreeNode::findNode(#SSRSReportsPath + #AOTDelimiter + reportName);
            if (reportNode)
            {
                // find the Designs folder
                designsNode = reportNode.AOTfindChild(#designsFolder);
                if (designsNode)
                {
                    // find first report design
                    designNodeIterator = designsNode.AOTiterator();
                    designNode = designNodeIterator.next();
                    while (designNode != null)
                    {
                        tmpDesignNames.DesignName = designNode.name();
                        tmpDesignNames.insert();
                        info(designNode.name());
                        designNode = designNodeIterator.next();
                        
                    }
                }
            }
        }
    


  • Faqruddin Profile Picture
    1,883 on at

    Hello Shoaib,

    I use above code in controller class. But how I can add this result to temp table and how I can present like a lookup to end user?

    Thanks

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    you may read one of my post, it can give you idea how you can present choice of design to end user.

    In my example I am using No/Yes infoBox, you can use dialog instead of that

  • Faqruddin Profile Picture
    1,883 on at

    Thanks for your reply Sohaib. Good example but this one helpful for only two designs. But in my case I have 3 designs and how I will pass the values for your above code. Please help me in this.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    you can pass N(any number of) designs.

    As I said, you can collect list of all design in a temporary buffer and you can provide that buffer as a drop-down to user. User can select any design.

    If you are looking exact code, wait few moments, unless I get free.

    Meanwhile also tell me, whether your report is based on print management or not?

  • Faqruddin Profile Picture
    1,883 on at

    Ok I will wait. No My report is not based on print management. I don't wants go with print management.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi Furqan,

    You can download sample code.

    PImg1.png

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I forget to mention that demo is developed on application version 6.3.164.0 (AX2012R3)

    No CU's etc.

  • Faqruddin Profile Picture
    1,883 on at

    Hello Shoaib,

    Great. Its working for above report as you shared. But I'm working on SalesPackingSlip report with 3 designs. I'm getting dialog box but in the drop down Report name there is no reports. Could you please check my main() method..

    public static void main(Args _args)

    {

       ReportDesignSelector ReportDesignSelector;

       Args                 rnArgs;

       ReportDesignName     vSRSReportDesignName;

       container            cont;

       ContainerClass       conClass;

       ReportName           vReportName="SalesPackingSlip";

       SrsReportRunController      formLetterController = SalesPackingSlipController::construct();

       SalesPackingSlipController  controller;

       ReportDesignSelector = new ReportDesignSelector();

       rnArgs      = new Args();

       cont        = [vReportName];

       conClass = new ContainerClass(cont);

       rnArgs.parmObject(conClass);

       vSRSReportDesignName = ReportDesignSelector.execProcess(rnArgs);

       if(vSRSReportDesignName && vSRSReportDesignName !=vReportName)

       {

           vSRSReportDesignName = vReportName+"."+vSRSReportDesignName;

          formLetterController.parmReportName(vSRSReportDesignName);

       }

         if (TaxThaiGovCertificationFeatureChecker::isUnrealizedVATEnabled()

           && _args.parmEnum() != PrintCopyOriginal::OriginalPrint)

       {

           SalesPackingSlipController::printDocumentSet(_args);

       }

       else

       {

       // </GTH>

           if (TradeFormHelper::isCalledFromForm(_args, formStr(CustPackingSlipJournalListPage)))

           {

               _args.record(CustPackingSlipJour::findRecId(_args.record().RecId));

           }

           controller = formLetterController;

           controller.initArgs(_args, ssrsReportStr(SalesPackingSlip, Report));

           if (classIdGet(_args.caller()) == classNum(SalesPackingSlipJournalPrint))

           {

               formLetterController.renderingCompleted += eventhandler(SalesPackingSlipJournalPrint::renderingCompleted);

           }

           formLetterController.startOperation();

       // <GTH>

       }

       // </GTH>

    }

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans