web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Document number not passed to expense report in Web Apps

(0) ShareShare
ReportReport
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

I have the same question (0)
  • MARC_ Profile Picture
    626 on at

    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

  • Verified answer
    DRobb Profile Picture
    40 on at

    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
    626 on at

    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 649

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 447 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 242 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans