1
votes

I want to iterate over the fields of an Axapta report. The problem I am facing is that I want to turn the fields visible and invisible before the report is shown. So I am overriding the Display method and add checkboxes to the Dialog.

I am looking for something that I can iterate over, like this

pseudocode:

public Object dialog(Object _dialog)
{
    ListIterator it;
    Dialog dialog;
    ;
    it = new ListIterator (this.fields); 
    dialog = super(_dialog);
    while (it.more())
    {
        dialog.addField(typeId(NoYesId),it.value);
        it.next();
    }
    return dialog;
}

How can I access the fields of a report ?

Further information:

I am using Dynamics Ax 4.0

1

1 Answers

2
votes

First, take a look on this question.

To access a report field, set the fields AutoDeclaration to Yes. Then the field is open for whatever:

stringControl.visible(...);

See report tutorial_FontInfo for an example of locating the control by name.

All controls of a report section can be accessed by number:

for (i = 1; i <= reportSection.controlCount); i++)
{
    rc = reportSection.controlNo(i);   
}