Remove blank lines in dataport

Aravindh_Navision
Member Posts: 258
Hi Friends,
Please find the below dataitem structure in dataport.
For example,
In Sales Invoice Line, I am having..
Can anyone help in doing this?
Thanks,
Aravindh
Please find the below dataitem structure in dataport.
DataItem Name ----------------------------------------------- Sales Invoice Header <Sales Invoice Header> Sales Invoice Line SIL_Tax_1 Sales Invoice Line SIL_Tax_2 Sales Invoice Line SIL_Tax_3 Sales Invoice Line SIL_Tax_4 Sales Invoice Line SIL_OtherI am using SIL_Tax_1, SIL_Tax_2, SIL_Tax_3, SIL_Tax_4 for calculating the VAT Amount Totals of 4 different VAT percentages say 0%, 10.50%, 21%, 27% respectively. I need to show only the totals of the available percentages in Sales Invoice Line in the text file.
For example,
In Sales Invoice Line, I am having..
1st record: 0% 2nd record: 21% 3rd record: 0% 4th record: 21% 5th record: 0% 6th record: 0%I need to add the VAT Amount of 0% and 21 % and show only those 2 lines in the text file and not for 10.5% and 27%. Currently I am getting a blank line for 10.5 % and 27% and those blank lines should be removed in the text file.
Can anyone help in doing this?
Thanks,
Aravindh
0
Answers
-
I am not sure but you can try OnBeforeExportRecord() trigger by checking any condition..0
-
Mohana,
I gave conditions also like..
if SIL_Tax_1."vat %" <> 21 then
currdataport.break;
It is not working0 -
Did you try by moving the above code to OnPreDataItem() trigger?0
-
Yeah.. I did that too..0
-
Make sure that you have right value in SIL_Tax_1."vat %"0
-
Yeah.. it contains correct values...0
-
Aravindh_Navision wrote:Remove blank lines in dataport
Is it posible these blank lines come form the DataItemSeparator property?
If yes, either modify the property and possibly write seperators to the file yourself as you need, or else modify the dataitem structure to match seperators and calculate VAT sums in your own C/AL loops.0 -
did you try
if "your condition" then begin
..do stuff..
end else begin
CurrDataport.SKIP; //instead of BREAK
end;
are you exporting or importing?0 -
Hi Savatage, I am exporting to text file. Also I tried with your suggestion... Its not working
Thanks,
Aravindh0 -
Hi Guys,
I found the solution for this issue and just wanted to share with you all that what I did. It is working fine in my case.
I wrote the following code in OnPreDataItem() of SIL_Tax_1, SIL_Tax_2, SIL_Tax_3 and SIL_Tax_4. Since the VAT % always remain sme in my case, I just hardcoded.SIL_Tax_1 - OnPreDataItem() SIL_Tax_1.SETRANGE("VAT %",0); IF SIL_Tax_1.COUNT = 0 THEN CurrDataport.BREAK; SIL_Tax_2 - OnPreDataItem() SIL_Tax_2.SETRANGE("VAT %",10); IF SIL_Tax_2.COUNT = 0 THEN CurrDataport.BREAK; SIL_Tax_3 - OnPreDataItem() SIL_Tax_2.SETRANGE("VAT %",15); IF SIL_Tax_2.COUNT = 0 THEN CurrDataport.BREAK; SIL_Tax_4 - OnPreDataItem() SIL_Tax_4.SETRANGE("VAT %",21); IF SIL_Tax_4.COUNT = 0 THEN CurrDataport.BREAK;
Thanks you all..
Aravindh0
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