Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Multiple Dynamic Datasources in MorphX Report

Posted on by 157

Hello to everyone

I am woking on a MorphX report in AX2009 (NOT SSRS)

I have the issue below:

I have one report that printed barcodes. Until now it worked as I will describe: 
The report printed after a dialog appeared. In this dialog you entered an ItemId, an InventLocationId and PrintNum which is how many times you wanted to print in this report the barcode. As you understand it is just an integer. 

Now I want to print this report with no dialog. I want to take the journalId from the form, with this journalId to take also the items that belong to this journal and make the exactly same function but in just one report.

For example, if I have a journal with 5 items inside and every item have PrintNum.value = 2. 

Then I want to see 10 barcodes in my report (5 * 2) 

It is possible to do it in one report, or I have to create somehow a loop that runs 5 times?

  • SGbron Profile Picture
    SGbron 157 on at
    RE: Multiple Dynamic Datasources in MorphX Report

    Thank you Gunjan

    You are the best... :)

    It was exactly that.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Multiple Dynamic Datasources in MorphX Report

    Hi,

    Could you please try changing inventTable join to an "outer join" as well and try running the query?

  • SGbron Profile Picture
    SGbron 157 on at
    RE: Multiple Dynamic Datasources in MorphX Report

    Hello Martin

    Thank you for you reply

    My previous query is now replaced by a select statement which working

    ok but not exaclty as I want

    I have this select statement:

    while select prodJournalId, itemId, myLocationId, totalQty from collectionProdJournalBOM
    
        where collectionProdJournalBOM.ProdJournalId == collectionProdJournalTable.ProdJournalId
    
        join inventTable
    
            where inventTable.ItemId == collectionProdJournalBOM.ItemId
    
        outer join myInventItemLocation
    
        order by printSequence
    
            where myInventItemLocation.InventItemLocation ==
    
            collectionProdJournalBOM.myLocationId

    As you understand the last join i make its only for the shorting of the lines.

    If I change the "outer join" I have, to "join" it works but it brings me back only the lines that has the mylocationId filled. If it is empty as it is normal.

    But when i use outer join i have this error:

    A data record in myInventItemLocation (MyInventItemLocation) cannot be selected.

    The join does not contain any link between the join tables in the WHERE clause.  

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Multiple Dynamic Datasources in MorphX Report

    Oh, so the whole thing about repeating is irrelevant and your actual question is how to make a query that returns five records?

    How does you query and code look at the moment?

  • SGbron Profile Picture
    SGbron 157 on at
    RE: Multiple Dynamic Datasources in MorphX Report

    Hello Martin

    I think I understand what you mean but if I proceed with this way, the result will be the same(I think).

    And that is because the difficult part cames after that.

    As I mentioned before, it already prints the barcodes as many times as the PrintNum is.

    The problem is that it process in this only for one item.

    So I think that the problem is what the report takes in the datasource. (If I explain it correct)

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Multiple Dynamic Datasources in MorphX Report

    It's a long time since I used MorphX reports, but couldn't you override executeSection() of the right section and call super() repeatedly (based on the value of PrintNum)?

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans