Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Answered

Document number not passed to expense report in Web Apps

Posted on by 40

Seems that we run into this two or three times a year. All of a sudden, we cannot print newly created expense reports or timecards. The old ones print perfectly. However, in the case of expense reports the SSRS report throws an error that the 'Document number was not passed to the report". 

Anyone have a quick and simple fix??

I would love to know the cause, but I'll settle for the resolution.

Thanks

  • MARC_ Profile Picture
    MARC_ 620 on at
    RE: Document number not passed to expense report in Web Apps

    Ok, sorry, I was way off! 

    Did you recently restore your test system DB?  If so, it's possible your production report server was pointed at test if you did not update the columns in the rs_reportserver table on your test DB after restore

    Glad you got it working!

    Marc

  • Verified answer
    DRobb Profile Picture
    DRobb 40 on at
    RE: Document number not passed to expense report in Web Apps

    I was advised by MS Support to rerun the ReportServerConfiguration. That cleaned up the error. I would just like to find the cause. No errors were logged in the Service or Client logs.

  • MARC_ Profile Picture
    MARC_ 620 on at
    RE: Document number not passed to expense report in Web Apps

    I would check the web app and service logs if you haven't already; my best guess is that you are hitting some error that is not properly setting the ExpenseHeader.DocumentNumber field.  When you click the report button, it runs a javascript function named DSLReportAction, which in turn calls LoadSSRSReport.  The document number parameter value is retrieved from the value in the Document input of the expense header section. 

    The function that actually calls the report is:

    LoadSSRSReport('/Project/Expense Report', { DocumentNumber: document.getElementById("ExpenseHeader.DocNumber").value, CallBack: '@Url.Action("ExpenseGrid", "ProjectExpense", New With {.CalledBy = "Report"})', Title: 'Expense Report' })

    If the expense header docnbr is not properly set, you would encounter the error you mention about missing param.   The next time this happens, click F12 in your browser and see if you have a console error (it's possible, but as you navigate away for the report, the error may be cleared)  and I would also run the code they use to grab the docnbr in the console to see if the proper value is returned: document.getElementById("ExpenseHeader.DocNumber").value

    If you have a console error, you are hitting some other (likely Javascript) issue that is not causing the screen to function as intended after the error.

    You could also alter the DSLReportAction function to check for valid docnbr before continuing to the LoadSSRSReport and either return or alert the user rather than continuing to the SSRS report to get the error.  this would then allow you to check the console before navigating away to the Report to try and get to the underlying issue.

    docnbr = document.getElementById("ExpenseHeader.DocNumber").value

    if (!docnbr || docnbr.length < 10) {alert ('Looks like we do not have a valid Document Number to run the report. Please contact ? and do not reload the page.' ); return}

     

    Sorry I couldn't give you a more concrete answer.  Good luck!

    Marc

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans