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)

SSRS Report error missing a value

(0) ShareShare
ReportReport
Posted on by 135

Hi, 

I have a report for PurchTable, there are two ways to call it. From dialog (filter by PurchId) and form button where the filter is the reg you select.

The first one works perfectly:

184676.1.png

but the second one gives me an error "missing value"

4606.2.png

I have a method "clicked" that takes the PurchId of the reg selected:

5684.3.png

And a Class for the report:

3036.4.png

2477.5.png

I think the problem is i don't add the parameter of the filter correctly, because i try to change the name of the parameter PurchTable_PurchId to PurchId on Visual Studio, and the error change to "parameter doesn't exist on the report".

I don't know how solve this. Any idea?

Thanks.

*This post is locked for comments

I have the same question (0)
  • MartaDiazVila Profile Picture
    135 on at

    Hi Crispin,

    i try your way but the error persist.

  • MartaDiazVila Profile Picture
    135 on at

    public void main(PurchId _purchId)

    {

       PurchTable purchtable;

       VSSClassControlPedidos  controller = new VSSClassControlPedidos();

       Args args2 = new Args();

       ;

       controller.parmReportName(ssrsReportStr(VSSReportControlPedidos2, VSSPrecisionDesignPed2));

       controller.parmReportContract().parmRdlContract().parmLanguageId("@SYS306440");

       controller.parmArgs(args2);

       controller.parmPurchId(_purchId);       //Filtrar sin necesidad del cuadro de diálogo (añadimos parámetro en class declaration)

       //controller.preRunModifyContract();

       controller.runToScreen();               //Abrir directamente sin pasar por ventana de diálogo

    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    void clicked()

    {

       Args args;

       str purch;

       VSSClassControlPedidos  controller = new VSSClassControlPedidos();

       ;

       args = new Args();

       purch = args.parm(PurchTable.PurchId);

       controller.main(purch);

       super();

    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    protected void preRunModifyContract()

    {

       Query reportQuery;

       if(purchId)

       {

           reportQuery = this.getFirstQuery();

           //a la query que ya tiene el informe por defecto, le añadimos un parámetro

           SrsReportHelper::addParameterValueRangeToQuery(

                               reportQuery, tableNum(PurchTable),

                               fieldNum(PurchTable, PurchId), SysQuery::value(purchId)/*purchId*/);

       }

       //super();

    }

  • MartaDiazVila Profile Picture
    135 on at

    First of all, thank for your help,

    Yes, i have an Output menuitem to show the report created on Visual Studio, and its works fine.

    The problem is i want (on PurchTable form and PurchTableListPage form) select a record, press button and the report open whitout the dialog. Open the report filter by the PurchId selected.

    With your code, when i press button the dialog window opens and its just because in properties of the menuItemButton i have MneuItemType (output) and MenuItemName(VSSReportControlPedidos2). I have to call the class from method click() (i think). By the way, i debug the code and purchtable = _args.record(); its not working, the value is <recId=0> and the field "".

    And still with the same error.

    Debugging i realised that in preRunModifyContract(), the query.firstQuery() return a null value. Maybe this is the problem.

    And i don't know if this is important but on visual studio i have Dynamic Filter to false.

  • MartaDiazVila Profile Picture
    135 on at

    The SSRS Report, the controler class is called VSSClassControlPedidos

  • MartaDiazVila Profile Picture
    135 on at

    ok, i changed everything, now i have the error-> method 'main' doesn't exist on object VSSClassControlPedidos.

    I chage public void main to public static main and its works, but now i have two problems:

    1. the error missing value still

    2. the args.record() doesn't catch anything.

    Even if i put 

    controller.parmPurchId("000013");

    It says that PurchTable_PurchId its empty

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