Search code examples
axaptadynamics-ax-2012x++

Report is empty - Report


I have created a report (no SSRS) in AX2012, via a Menu Item I am running this report, i want to achieve to show the AssetId, from the Asset Record i have selected.

My Dialog method:

    public Object dialog(Object _dialog)
{
    DialogRunbase dialog = _dialog;
    ;

    dialogAssetIds = dialog.addField(ExtendedTypeStr(AssetId));

    return dialog;
}

My getFromDialog method:

 public boolean getFromDialog()
{
    ;
    curAssetId = dialogAssetIds.value();

    return true;
}

I also have created a display method to return the value:

    display AssetId assetId()
{
    return curAssetId;
}

On my report field, I have selected the above method to show the AssetID number, obviously I am missing the key link, but I am not sure what.

I am receiving the error:

Report is empty - Report

Eventually, I want to print the AssetId number without the dialog field, based on the selected record, I have built in the dialog so I am sure nothing was wrong with printing the value directly.


Solution

  • Guessing what went wrong with your report requires more data, but ...

    You do not need a RunbaseReport class or any code to achieve this behavior.
    Just set the AutoJoin property to Yes on your report's AOT node.
    Change your menu item to reference the report. Add the menu item to your Asset form, remember to set the DataSource property of the control to the AssetTable datasource.

    Then by magic it works provided dynalink on form table and report table is established. If the report is called from the main menu there is no autojoin of cause, it will select whatever the user queried.

    Works for MorphX reports, not for SSRS reports. SSRS sucks (again, and again ...).