mibuso.com

Microsoft Business Solutions online community
It is currently Sun May 19, 2013 6:27 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: XMLPort ignoring <NewLine> as RecordSeparator
PostPosted: Tue May 29, 2012 10:23 am 
Offline

Joined: Thu Jul 13, 2000 7:01 am
Posts: 24
Location: Midrand, South Africa
Country: South Africa (za)
Hi there

I have picked up strange behaviour on XMlPorts when importing a TAB delimited text file when using <None> as the FieldDelimiter and <NewLine> as the RecordSeparator.

My test import file has 3 columns and 3 rows and it looks like this:
A1 "B1", C1
A2 "B2", C2
A3 "B3", C3

I have created a Dataport that imports the file without problems but when trying to create an XMLPort that imports the same file the XLMPort does not recognise the linefeed/character return value in the file and it only imports the first line.

Please can I ask you to take a look at my XMlPort and tell me whether you know of a property that I have missed or a setting that I can use to replicate the behaviour of the Dataport?

My two NAV objects are shown below. You can add the XMLPort to a Page Action to run it from the RoleTailored client - neither of these two import functions actually import any data at this point, it's just a test and the import functions display a MESSAGE dialog after importing every line to show the data imported into the 3 different columns.

NAV Objects:
OBJECT Dataport 99012 Import Tab Delimited File
{
OBJECT-PROPERTIES
{
Date=29/05/12;
Time=08:57:43 AM;
Modified=Yes;
Version List=IMPTABFILE1.0;
}
PROPERTIES
{
FieldStartDelimiter=<None>;
FieldEndDelimiter=<None>;
FieldSeparator=<TAB>;
}
DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table2000000026;
AutoSave=No;
AutoUpdate=No;
AutoReplace=No;
OnAfterImportRecord=BEGIN
Value1 := ColumnA;
Value2 := ColumnB;
Value3 := ColumnC;
Value4 := '';
END;

}
FIELDS
{
{ ; ;ColumnA }
{ ; ;ColumnB }
{ ; ;ColumnC }
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=9020;
Height=3410;
}
CONTROLS
{
}
}
CODE
{
VAR
ColumnA@1000000000 : Text[30];
ColumnB@1000000001 : Text[30];
ColumnC@1000000002 : Text[30];
Value1@1000000003 : Text[30];
Value2@1000000004 : Text[30];
Value3@1000000005 : Text[30];
Value4@1000000006 : Text[30];

BEGIN
END.
}
}

OBJECT XMLport 99012 Import Tab Delimited File
{
OBJECT-PROPERTIES
{
Date=29/05/12;
Time=09:51:57 AM;
Modified=Yes;
Version List=IMPTABFILE1.0;
}
PROPERTIES
{
Direction=Import;
Encoding=UTF-8;
OnPreXMLport=BEGIN
ImportCounter := 0;
END;

Format=Variable Text;
FieldDelimiter=<None>;
FieldSeparator=<TAB>;
RecordSeparator=<NewLine>;
UseRequestForm=No;
}
ELEMENTS
{
{ [{9EB37C52-4B99-4A66-B412-8F4824F27F07}]; ;Root ;Element ;Text }

{ [{7749CBA2-87B1-45A4-859B-96F1F655C1FF}];1 ;Import ;Element ;Table ;
SourceTable=Table2000000026;
Temporary=Yes;
LinkTableForceInsert=No;
Import::OnBeforeInsertRecord=VAR
lvTempAccNo@1000000004 : Code[100];
lvTempICCode@1000000003 : Code[100];
lvDaytxt@1000000002 : Text[30];
lvMonthtxt@1000000001 : Text[30];
lvYeartxt@1000000000 : Text[30];
lvAmountDec@1000000005 : Decimal;
lvDimValue@1000000006 : Record 349;
BEGIN
ImportCounter += 1;
Integer.Number := ImportCounter;

MESSAGE(ColumnA, ColumnB, ColumnC);
END;
}

{ [{9DDAAE0A-DD30-44C4-96D7-12CD375AE4A1}];2 ;ColumnA ;Attribute;Text ;
Width=1024 }

{ [{F4615471-47B9-4B84-9168-EAB400C9CE5B}];2 ;ColumnB ;Element ;Text }

{ [{4993A052-32AD-48A6-B50D-1C27D550B5C7}];2 ;ColumnC ;Element ;Text }

}
EVENTS
{
}
REQUESTPAGE
{
PROPERTIES
{
}
CONTROLS
{
}
}
CODE
{
VAR
ImportCounter@1000000000 : Integer;

BEGIN
END.
}
}


Top
 Profile E-mail  
 
 Post subject: Re: XMLPort ignoring <NewLine> as RecordSeparator
PostPosted: Tue May 29, 2012 3:11 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8699
Location: 3rd rock from sun
Country: United States (us)
can you attach your actual file?

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: XMLPort ignoring <NewLine> as RecordSeparator
PostPosted: Tue May 29, 2012 5:05 pm 
Offline

Joined: Thu Jul 13, 2000 7:01 am
Posts: 24
Location: Midrand, South Africa
Country: South Africa (za)
I tried uploading my objects in txt, fob and zip format but I get an error "The extension xyz is not allowed.".

Is there another way to upload objects other than to try and add them as part of the post using the "Upload attachment" section at the bottom?


Top
 Profile E-mail  
 
 Post subject: Re: XMLPort ignoring <NewLine> as RecordSeparator
PostPosted: Wed May 30, 2012 1:53 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8699
Location: 3rd rock from sun
Country: United States (us)
There are other website where you can upload files and post a link. I use google https://sites.google.com

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to:  
cron