Options

Error System.OutOfMemoryException when running a 2013 report

poppinspoppins Member Posts: 647
edited 2014-01-07 in NAV Three Tier
Hi everyone,

I am trying to run a nav 2013 report and getting the following error:
An error occured during local report processing.
An error has occured during report processing.
Exception of type 'System.OutOfMemoryException' was thrown.

The stange thing is that for the date filter, the report sometimes generates correctly, sometimes throws this error but displays only a part of the data supposed to be rendered, and sometimes throws the eroor with no data displayed at all...

What shall I do?

Comments

  • Options
    CharlehCharleh Member Posts: 44
    Does your report include any images? Sometimes clients like to use header/company logo images or footer addresses that are in image format.

    Occasionally these items can be very large (several megabytes - sometimes 10 or more) and when NAV does the server side processing, depending on how the data relations have been designed, it can attempt to build a huge XML dataset and repeat the image many times. This can sometimes lead to the report dataset being bigger than the available memory on the client - so when NAV sends it across, your client machine can't handle it (after the data fetch the report processing actually happens on the client)

    If so you might want to try and run the report with a small number of rows (a small date filter) and then use the "About this report" feature. If there is an image column it will be displayed as a * (binary data). The solution to this issue is to ensure that the image only appears in a single data item (add another data item to the root). I think doing a CLEAR on the image variable after the first fetch might also work - but can't confirm
    Charleh
  • Options
    poppinspoppins Member Posts: 647
    Charleh wrote:
    Does your report include any images? Sometimes clients like to use header/company logo images or footer addresses that are in image format.

    Occasionally these items can be very large (several megabytes - sometimes 10 or more) and when NAV does the server side processing, depending on how the data relations have been designed, it can attempt to build a huge XML dataset and repeat the image many times. This can sometimes lead to the report dataset being bigger than the available memory on the client - so when NAV sends it across, your client machine can't handle it (after the data fetch the report processing actually happens on the client)

    If so you might want to try and run the report with a small number of rows (a small date filter) and then use the "About this report" feature. If there is an image column it will be displayed as a * (binary data). The solution to this issue is to ensure that the image only appears in a single data item (add another data item to the root). I think doing a CLEAR on the image variable after the first fetch might also work - but can't confirm

    Thank you for your effort, but no image at all....
  • Options
    davmac1davmac1 Member Posts: 1,283
    You don't mention the specific report.
    The inventory revaluation report can fail with this message because it can send a massive amount of data to the report layer. The fix for this type of problem is to either redo the report in SQL to make it more efficient, or add code to the report to cut down the data sent to the RDLC and make any changes needed in Visual Studio to the report.
  • Options
    CharlehCharleh Member Posts: 44
    Yes good point, inventory valuation report has Item -> Value Entry data set. To be honest you can quite easily change the report to do the processing it needs in the first data item ("Item") and summarise the value entries as variables (the report itself never uses the value entry data other than to provide a summary but NAV sends all value entries across as part of the data set!)

    In a scenario with 8,000 items with 100 value entries each you are looking at 800,000 rows

    If you customise to ensure that processing is done at the Item level, you will have at most 8000 summarised rows.
    Charleh
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    I'm getting the same message on the report 204 Sales Quote. Too big dataset. Sales quote report at customer site is 6 to 8 pages long normally. So probably creating report from scratch is best now.
    That's gonna be a lot of work. :(

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    geordiegeordie Member Posts: 655
    tinoruijs wrote:
    I'm getting the same message on the report 204 Sales Quote. Too big dataset. Sales quote report at customer site is 6 to 8 pages long normally. So probably creating report from scratch is best now.
    That's gonna be a lot of work. :(

    Before creating a new report, try to apply this workaround :wink:
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    geordie wrote:
    tinoruijs wrote:
    I'm getting the same message on the report 204 Sales Quote. Too big dataset. Sales quote report at customer site is 6 to 8 pages long normally. So probably creating report from scratch is best now.
    That's gonna be a lot of work. :(

    Before creating a new report, try to apply this workaround :wink:

    Thanks for the tip!

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    geordie wrote:
    tinoruijs wrote:
    I'm getting the same message on the report 204 Sales Quote. Too big dataset. Sales quote report at customer site is 6 to 8 pages long normally. So probably creating report from scratch is best now.
    That's gonna be a lot of work. :(

    Before creating a new report, try to apply this workaround :wink:

    I haven't succeeded yet in correct applying the workaround, but disabling "Logo position on documents" in the Sales & Receivables Setup, decreased the size of my dataset.xml.
    It went from 150662 kb to 304 kb. :)
    So I'm gonna make that workaround work. ;-)

    Thanks!

    Tino Ruijs
    Microsoft Dynamics NAV specialist
Sign In or Register to comment.