Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

SSRS Report error missing a value

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

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SSRS Report error missing a value

    Ok, it was an old modification i forget to delete, now i have the correct record, but the error still

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: SSRS Report error missing a value

    In your main method, remove the line

    Args _args = new Args();

    Why do you have such line? That will overwrite the real _args that was passed to the main method with a new empty Args object!

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SSRS Report error missing a value

    No, i don't have the correct record:

    00543.2.png

    00543.2.png

    4101.3.png

    On Visual Studio, if i change the property of parm to allow null/empty to true the records opens, but with no filter. So i think the problem is im not get pass the value filter correctly.

    If it's not that, i don't know what can be.

    IMPORTANT (I think)

    i have this method:

    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();
    }

    When i debug, the program do not enter in this mathod, I try to call it from main and i realized than reportQuery = this.getFirstQuery(); return a null value.

    
    
  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: SSRS Report error missing a value

    What do you mean by "both" clicked methods? Did you remember to add the Data source property for both buttons? Where is the second button?

    I think we should first concentrate on making one button work, and then you can apply the same solution to your second button. 

    So, going back to your main method.

    Do you now have the correct record in purchTable variable after this line:

    purchtable = _args.record();


    If yes, then we know that everything looks good until this, and the problem is in your controller class. You already said you get some error about missing PurchTable_PurchId even if you specify yourController.parmPurchId value. So that really indicates that your controller class doesn't know how to handle that purchId parameter. 

    Could you describe the current status in detail. Do you get some errors? Also please share more details about your controller class.

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SSRS Report error missing a value

    Yes, i deleted  both clicked() method, and yes, i have selected a record. I added NeedsRecord = Yes. Nothing changed.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: SSRS Report error missing a value

    And you don't have the clicked() method of the button overwritten anymore? If you do, please delete the method.

    Do you have a selected Purchase order in the calling form? To make sure, you can also add "NeedsRecord = Yes" in the button properties.

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SSRS Report error missing a value

    3465.1.png

    I have this in two forms (DataSource PurchaseTable on ListPage Form). 

    args.record() still not working, I'm desesperate :(

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: SSRS Report error missing a value

    Your menuItemButton has to be associated with a data source on the calling form.

    So please specify property DataSource either on the button group or the individual button.

  • MartaDiazVila Profile Picture
    MartaDiazVila 135 on at
    RE: SSRS Report error missing a value

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans