Nav 2013 repeated image in XML dataset solution

Charleh
Member Posts: 44
Just a quick tip for anyone struggling with this in case no one has mentioned it
A couple of our clients have moved to 2013, and when running reports off which have many hundreds of rows they were getting a .NET OutOfMemoryException whilst processing the report on the client. It turns out that their company letterhead images were in the range of megabytes (1/2 megs) and due to the way the XML dataset is built on the server the client ends up receiving the image data multiplied by the number of rows in the dataset.
In order to mitigate this, I put a Boolean flag in the report and after the first data item had been built, I then cleared the image column using CLEAR(). This cut the dataset down from several hundred megs to several kilobytes, solving the clients issue.
Code was approx.:
A couple of our clients have moved to 2013, and when running reports off which have many hundreds of rows they were getting a .NET OutOfMemoryException whilst processing the report on the client. It turns out that their company letterhead images were in the range of megabytes (1/2 megs) and due to the way the XML dataset is built on the server the client ends up receiving the image data multiplied by the number of rows in the dataset.
In order to mitigate this, I put a Boolean flag in the report and after the first data item had been built, I then cleared the image column using CLEAR(). This cut the dataset down from several hundred megs to several kilobytes, solving the clients issue.
Code was approx.:
OnAfterGetRecord IF NOT LogoLoaded THEN LogoLoaded := TRUE ELSE CLEAR(SomeTable.Picture)If anyone has a better way to address this, I'd like to know as it doesn't appear to be addressed in the latest NAV build (and I'm not sure how it would be addressed)
Charleh
0
Comments
-
Works great!
I've implemented it on report 204 Sales Quote;IF NOT LogoLoaded THEN BEGIN; LogoLoaded := TRUE; END ELSE BEGIN; CLEAR(CompanyInfo1.Picture); CLEAR(CompanyInfo2.Picture); CLEAR(CompanyInfo3.Picture); END;
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
Fantastic Charleh!
Worked for me too also using the sales quote. We had one quote which had 90 pages and although it previewed after a couple of minutes it would not print, giving an out of memory exception. Now it flies, previewing in less than 5 seconds and prints fine. I think I will use this for all reports going forward that use images.
Bruce Anderson0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions