Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

AX2012 SSRS sub report

Posted on by 320

Hi,

i try to extend the SalesConfirmation and SalesInvoice report, and therefore created a new table, extended the data provider, all that worked well.

But when i wanted to add fields from the new dataset to the lines section in the report by a tablix, i was not allowed to change the datasource. In some posts i read to use a subreport instead, but when i added the subreport to the tablix, i have no dropdown in the "Use this report as a subreport:"-field, and whatever i enter there manually is not accepted.

Error message: "The report definition for report '{Reportname}' has not been specified"

I tried different notations: xyzReport, xyzReport.Designname, DynamicsAX.xyzReport.Designname etc

Can anyone tell me please, if it is possible to add a subreport to the formletters (e.g. SalesConfirmReport), and what i have to do to get a drop down in that field, or which notation i need to put a report name there.

Thanks,

harald

*This post is locked for comments

  • Brandt Fundak Profile Picture
    Brandt Fundak 2,005 on at
    RE: AX2012 SSRS sub report

    Esther,

    You define the parameter via the Subreport properties in the main report. Since the main report doesn't know what properties your subreport might have. You have to define the name of the parameter (make sure that it matches what the parameter in your subreport design is called or you'll get an error. I think you should be able to put D0002 (with no quotes) as the value, but if you want to make completely sure that it is right, open the Expression editor (fx button) and enter either the value ="D0002."

    Remember as mentioned above, you will need to save to the AOT and deploy both the report and subreport to test. Visual Studio does not know how to render the subreport in VS, so you have to do it AX.

    Hope that helps.

    Brandt

  • Esther Mulijono Profile Picture
    Esther Mulijono 435 on at
    RE: AX2012 SSRS sub report

    Hi Lucas,

    How to set value of the parameters in the subreport?

    I've added the subreport to my main report, it works well without parameters.

    But I need to use parameter in my subreport.

    I've added parameter from the subreport properties, but I confused how to add the value. Lets say that I want to use a hardcoded value. Should I fill the value with something like "D0002" in the value text box? or simply just the string D0002 without the quote?

    Thank you in advance,

    Esther

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX2012 SSRS sub report

    Hello everyone, I tried the Stefan Quinn solucion, but in Visual Studio it did not work. Running the report inside AX, it worked.

    Sad but it's true.

    Don't forget the AX_CompanyName parameter on SubReport.

  • Hisham Alsayed Profile Picture
    Hisham Alsayed 739 on at
    Re: AX2012 SSRS sub report

    Hi Stefan Quinn ,

              Kindly, i face the same problem could you clarify your solution more ? , waiting for your reply ASAP ,thanks.

  • Stefan Quinn Profile Picture
    Stefan Quinn 80 on at
    Re: AX2012 SSRS sub report

    Ok

    Round of applause for how badly SSRS is implemented in AX 2012.  What is a robust and easy to use product is stupidly complex in AX!

    My advice is to only use AX SSRS if you absolutely have to, otherwise just use regular SSRS.

    Anyway, the only way I could get sub reports to work in AX SSRS is to do the following:

    1.      Your sub report must be in the same visual studio project as your main report. 

    2.      Create your sub report control and link to the sub report. In REAL SSRS in the sub report properties box, the sub report is then in a drop down list.  Not so in AX SSRS.  You have to type in the report name with the .design, e.g. mySubReport.PrecisionDesign1

    3.      Manually add your parameters to pass them from the parent to the sub report.  Again REAL SSRS used drop down boxes, but AX SSRS, you guessed it, you have to type them in.

    I tried for hours to use a sub report that got its data from a query that had a range, in the hope that I could pass the parent report parameter to use this range.  The parameter shows up as a dynamicParameter, but alas couldn’t get it to work.

    The only way I could get this all to work was to use a report data provider for the sub report, and in AX have a data contract for the parameter for this data provider

    See below for my contract code

    [

        DataContractAttribute

    ]

    class SAB_ConsRptJobCardContract

    {

        ProjId  projID;

    }

    [

        DataMemberAttribute('ProjID')

    ]

    public ProjId paramProjID(ProjId _projID = projID)

    {

        projID = _projID;

        return projID;

    }

     

     

     

  • Jan M. Profile Picture
    Jan M. 3,221 on at
    Re: AX2012 SSRS sub report

    Hi Harald

    Any public information, statement from MS regarding this?

    Thanks, Jan

  • Harald Paul Profile Picture
    Harald Paul 320 on at
    Re: AX2012 SSRS sub report

    Hi Dane,

    sorry to say, in the meantime MS verified this case: sub reports do not work with data providers in precision design.

    Kr, harald

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: AX2012 SSRS sub report

    Hi, I have the same question for the "Use this report as a subreport" field. Have you find some solution?

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!

Community AMA December 12th

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

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans