Very Slow Report

siyak
Member Posts: 66
Hi there good people!! Please help ](*,)
I've created a report which has the following dataitems
(
Customer
Sales Cr.Memo Header
Account Types
Customer Bank Account
)Indented in that order and i have this code under Sales Cr.memo Heder(
PostedDocDimension.SETRANGE(PostedDocDimension."Table ID",114);
PostedDocDimension.SETRANGE(PostedDocDimension."DimensionCode",'ACCTYPE');
PostedDocDimension.SETFILTER(PostedDocDimension."Document No.","Sales Cr.Memo Header"."No.");
PostedDocDimension.SETFILTER(PostedDocDimension."Line No.",'0');
IF PostedDocDimension.FIND('-') THEN;
vCust.SETFILTER("No.",AccType."Customer No.");
vCust.FIND('-');
CampaignNo := "Sales Cr.Memo Header"."Campaign No.";)
Itried to the SETCURRENTKEY(SETCURRENTKEY("Sell-to Customer No.","No."),
It is working very well,but it is very very slow
I've created a report which has the following dataitems
(
Customer
Sales Cr.Memo Header
Account Types
Customer Bank Account
)Indented in that order and i have this code under Sales Cr.memo Heder(
PostedDocDimension.SETRANGE(PostedDocDimension."Table ID",114);
PostedDocDimension.SETRANGE(PostedDocDimension."DimensionCode",'ACCTYPE');
PostedDocDimension.SETFILTER(PostedDocDimension."Document No.","Sales Cr.Memo Header"."No.");
PostedDocDimension.SETFILTER(PostedDocDimension."Line No.",'0');
IF PostedDocDimension.FIND('-') THEN;
vCust.SETFILTER("No.",AccType."Customer No.");
vCust.FIND('-');
CampaignNo := "Sales Cr.Memo Header"."Campaign No.";)
Itried to the SETCURRENTKEY(SETCURRENTKEY("Sell-to Customer No.","No."),
It is working very well,but it is very very slow
0
Comments
-
Its still very slow0
-
Use SETRANGE instead of SETFILTER.
SET DataItemTableView and DataItemLinkReference and DataItemLink ...
BTW, is there any other code in your report? I don't think it should be that slow while running so few codes...0 -
Hi Siyak,
Why are you not using GET instead of FIND - look to me like you are looking up the primary keys on the customer and posted document dimension tables
i.e.
if PostedDocDimension.GET(114,.","Sales Cr.Memo Header"."No.", 0, 'ACCTYPE' ) then
...
if vCust.GET(AccType."Customer No.") then
...
This may not be the only cause for the report to slow down - the links on the dataitems would need to be examined.
Hope this helps0 -
I'm using the SQL Database.
I have these on the DataitemTableviewof Sales Cr Memo(SORTING(Sell-to Customer No.,No.) and Customer(Sorting(No.))and Customer Bank Account(SORTING(Customer No.,Code)) the DataItemLink are fine.0 -
its about 2,097,152 kb.0
-
Hi Siyak,
Can you explain what you are trying to acheive as the design of report is very important.
For example you have a dataitem for customer and are then using a variable vCust to get customer details again :-s
Also on the dataitem link you don't seem to have (or maybe didn't post) any where clause so this would mean looping all credit notes for each customer and not just the credit notes for that customer.0 -
On the Account Types Section body i have(Customer No. and name from Customer table and Credit Memo.No From redit memo table and Payment method,Payment type,credit Rep From Account types table) and on the Customer Bank account Body(Code,Description and Bank account no.from Customer Bank Account Table)
That is the way it looks.It works very well but its slow ](*,)0
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