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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Unable to print shipment, error "Object reference not set to an instance of an object"

(0) ShareShare
ReportReport
Posted on by 325

Hi,

We have made a few changes to a report that we use for Shipment of Sales Orders. The changes are only a few new fields and some calculation done on OnAfterGetRecord on both "Sales Shipment Header" and "Sales Shipment Line". After the changes we get an error whenever we try to print the report. The error message says "Object reference not set to an instance of an object". Everything works fine in our development environment as well as in the customer test environment. It does not matter if we use the Post & Print function from the Sales Order or try to print from the posted document. It also does not matter if we print to a PDF of to a printer. And the report worked without any issues before the changes. 

The customer is using Dynamics NAV 2013 R2, Build 7.10.36366 that runs on Windows Server 2012 R2. The SQL Server version is 2012, also running on Windows Server 2012 R2. The test environment is running on a different set of servers, but the same server versions. What can be causing this problem and how do we fix it? I have tried the solution in this page, http://www.mibuso.com/forum/viewtopic.php?f=32&t=54857&view=next, but there were no filters written in the way that does not work.

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Have you used any Report Items in the report, if increase the width of the hidden text boxes else try to achieve the same using code.setdata ,code.Getdata

    Regards

    Rajasekhar.Y

  • helm Profile Picture
    325 on at

    Hi

    Yes, it is using Report Items. OK, I'll try that. Is there a recommended minimum width for these kind of fields?

    Thanks

  • Rajasekhar@MS Profile Picture
    5,569 on at

    Yes, you have to maintain the width so that the text in the Textboxes is visible a bit. 

  • Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    The same report changes are working fine in TEST and DEV, but not in PROD ?  If so, normally the error you are getting could be because of filters but if it is working in an environment and not in other then it could be related to metadata issue.

    Try to delete the metadata from the following table for that report

    User Metadata

    Object Metadata

    Page Data Personlization

    recompile the report and try again

  • mmv Profile Picture
    11,471 on at

    Hi,

    You may try to delete the Object Metadata and try Build the Application Server objects again.

  • helm Profile Picture
    325 on at

    I have tried all the suggestions without resolving the issue. Does anybody have another idea?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Please check the event viewer and paste any additional details if you see there.

  • helm Profile Picture
    325 on at

    Sorry about the lack of updates, it's difficult to get opportunity to test in a live database. Don't when the next one will appear.

  • Community Member Profile Picture
    on at

    Did you find a solution to the problem?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans