Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Data is not rendering for first time but rendering fine from second time onwards in SSRS report

(0) ShareShare
ReportReport
Posted on by 2,457

This is causing for one field only. It looks weird as I haven't seen this issue before.

Please let me know how to figure out this issue.

Thanks,

Raziq.Ali

*This post is locked for comments

  • Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    Hi Raziq,

    Kindly unmark, any reply from my side as non-verified. As none of my replies are accurate to fix issue. Its due to fact that yet we were unable to identify/ reproduce  exact reason of issue.

    Marking my answer as verified, is misleading for new comers, who might be searching this thread in future.

    Keep only your findings as Verified answer & change my replies from Verified to non-verified.

  • Suggested answer
    Mohammad Raziq Ali Profile Picture
    2,457 on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    Hi Sohaib, I got solution for this issue. Here you go...

    This is happening because of the combination of standard code, and existing records. 

    There is this code in the SalesInvoiceDPBase class: 

    public void processReport()

    {

        if (!this.useExistingReportData())

        {

            this.setTableConnections(); 

            this.createData();

        } 

    }

     The this.useExistingReportData() method has the following line of code: 

    localSalesInvoiceHeaderFooterTmp = SalesInvoiceHeaderFooterTmp::findJourRecId(jourRecId); 

    Basically, if it is able to find a record in the SalesInvoiceHeaderFooterTmp table for the given Journal Rec Id, it will use the existing data, instead of creating new data. Since my field is new, it is not populated on the existing data, hence I see blank values on the “first” run (I put that in quotes, since this is not really the first time this report has been run for this journal… just the first time during my testing).

    At the end of the “first” run, the report does the correct thing, and deletes the data out of the SalesInvoiceHeaderFooterTmp table, leaving it empty for the second run. Since there is no existing data in the second run, it builds it all from scratch (this time with my new value).

    Thanks,

    Raziq.Ali

  • Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    Hi Raziq,

    I understand how invoicing works in AX. Also I do understand issue form “end user’s” perspective.

    My question is reproducing issue, in technical terms. How I can reproduce issue, technically. What I should code/customize etc. to produce this issue.

  • Mohammad Raziq Ali Profile Picture
    2,457 on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    Below are the steps which I followed for SO-0007106 to reproduced it in DEV.

     

    6735.4.png

     When I click on Invoice for this SO, it opens Invoice journal form

     1440.2.png

     When I click on preview/print to generate report.

    0882.3.png

     It has generated report with blank packing list number for first time which I attached for reference.

    6735.4.png 

    When I run again for second time, it rendered perfectly which I attached for your reference.

    5287.5.png 

    Report is rendering perfectly from second time onwards.

    Thanks,

    Raziq.Ali

  • Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    interesting.

    can you kindly provide me steps to re-produce issue. doing so, can help me to debug on my DEV box

  • Mohammad Raziq Ali Profile Picture
    2,457 on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    I meant code is also stepping into debugger mode from second time onwards but not from first time.

  • Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    probably because reports run through BI services which is an AIF service and runs under CIL.

    To debug it you need to follow certain process which you can find on TechNet.

    https://technet.microsoft.com/en-gb/library/gg724081.aspx

  • Mohammad Raziq Ali Profile Picture
    2,457 on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    I kept my debugger to find out cause but it is not stepping in createdata method of SalesInvoiceDpBase class for first time. So, very hard to find root cause I guess.

  • Verified answer
    Sohaib Cheema Profile Picture
    46,614 User Group Leader on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    SalesInvoiceDP is an extended class of SalesInvoiceDPBase

    basically method insertIntoSalesInvoiceTmp  is called from createData method of insertIntoSalesInvoiceTmp .

    your event says that code should be called before insertIntoSalesInvoiceTmp .

    can you kindly debug SalesInvoiceDPBase to know how and when insertIntoSalesInvoiceTmp   is being called.

  • Mohammad Raziq Ali Profile Picture
    2,457 on at
    RE: Data is not rendering for first time but rendering fine from second time onwards in SSRS report

    This is pre event handler added to insertIntoSalesInvoiceTmp method of SalesInvoiceDP class.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,863 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans