vendredi 19 novembre 2010

How to connect between report and RunBaseReport class in Dynamics AX

For example you want to make your report dynamic, you choose to display or not a programmable section or any other section of your design, or you choose the appropriate design...
 For example in you Runbasereport class, in the dialog method , you create a Combobox

public Object dialog()
{

    DialogRunBase      dialog = super();
    ;
    printJobSettings.setTarget(PrintMedium::Screen);
    dialog.addGroup("@SYS105079");
    dialog.addText("@PAY5597");
    NoYesCombo = dialog.addField(typeid("NoYes"));

    return dialog;
}

You get it value in the getDialogValue method : 

public NoYes getFromDialog()
{
    ;
    showHolidaySection = NoYesCombo.value();
  
    return  super();
}

And you return this value in order to use it :


public NoYes getShowHolidaySection()
{
    ;
    return showHolidaySection;
}

According to the value of this Combobox, you will display or not a programmable section.
You call this fonctionality in the fetch method of the report here.

 if (payslipJour.PayrollShowVacationAccount)
    {
        if ( myCaller.getShowHolidaySection() == NoYes::Yes)
        {
            this.execute(1);
        }
    }

Another good example to follow is found in the resources.

Happy Daxing!

Aucun commentaire:

Enregistrer un commentaire