Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
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,417 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 225,672 Super User 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 225,672 Super User 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)?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans