Error trying to Import from a TXT File with a XMLPort

albert_1982
Member Posts: 33
Is the first time i use xmlports, so maybe something is wrong.
Error appears when I execute codeunit that calls the XmlPort.
"Error configuring XML analizer
Error = c00cee2d Code meaning=Unknown error 0xC00CEE2D"
Any idea about how to solve that?
Another question: Is possible to call the xmlport, and show a requestform to ask for the file path, without using a codeunit?
Thank you very much.
Just some context to suport the question
I´m using W.vista
Executing from Clasic Client 6.0
I Create the codeunit:
57100 "UPload TXT File"
With this code:
Then I create XMLPort, 57100 with this definition
that read one row and then i split the row to fill fields.
Node Name Node Type Source Type Data Source
Root Element Text <Root>
Import Element Table <Integer>(Integer)
IOGCadena Element Text <IOGCadena>
and this code
Error appears when I execute codeunit that calls the XmlPort.
"Error configuring XML analizer
Error = c00cee2d Code meaning=Unknown error 0xC00CEE2D"
Any idea about how to solve that?
Another question: Is possible to call the xmlport, and show a requestform to ask for the file path, without using a codeunit?
Thank you very much.
Just some context to suport the question
I´m using W.vista
Executing from Clasic Client 6.0
I Create the codeunit:
57100 "UPload TXT File"
With this code:
OnRun() BEGIN IF ISSERVICETIER THEN BEGIN IF UPLOADINTOSTREAM('Select File:','C:\Temp','TXT File *.txt| *.txt',ClientFileName,TestStream) THEN MESSAGE('Uploaded File') ELSE EXIT; END ELSE BEGIN TestFile.OPEN('C:\Temp\N43.txt'); TestFile.CREATEINSTREAM(TestStream); END; XMLPORT.IMPORT(57100,TestStream); IF NOT ISSERVICETIER THEN TestFile.CLOSE; END;
Then I create XMLPort, 57100 with this definition
that read one row and then i split the row to fill fields.
Node Name Node Type Source Type Data Source
Root Element Text <Root>
Import Element Table <Integer>(Integer)
IOGCadena Element Text <IOGCadena>
and this code
Import - Export::OnPreXMLItem() IF IOGLinConcil.FIND('+') THEN IOGContador := IOGLinConcil."Nº línea" + 10000 ELSE IOGContador := 10000; IOGLinConcilAnterior.INIT; Import - Import::OnBeforeInsertRecord() IOGLinConcil.INIT; IOGTipoLinia:=COPYSTR (IOGCadena,1,2); IF IOGTipoLinia='23' THEN IOGConcepte := COPYSTR(IOGCadena,43,38); IF IOGTipoLinia ='22' THEN BEGIN IOGDebeOHa := COPYSTR (IOGCadena, 28, 1); IF (IOGDebeOHa < '1') OR (IOGDebeOHa > '2') THEN currXMLport.SKIP; EVALUATE (IOGImporte, COPYSTR (IOGCadena, 29, 14)); IF IOGImporte = 0 THEN currXMLport.SKIP; IOGImporte := IOGImporte / 100; IF IOGDebeOHa = '1' THEN IOGLinConcil.VALIDATE (Haber, IOGImporte) ELSE IF IOGDebeOHa = '2' THEN IOGLinConcil.VALIDATE (Debe, IOGImporte); IF NOT EVALUATE (IOGAño, COPYSTR (IOGCadena, 11, 2)) THEN currXMLport.SKIP; IF NOT EVALUATE (IOGMes, COPYSTR (IOGCadena, 13, 2)) THEN currXMLport.SKIP; IF NOT EVALUATE (IOGDia, COPYSTR (IOGCadena, 15, 2)) THEN currXMLport.SKIP; IOGLinConcil."Nº línea" := IOGContador; IF (IOGAño >= 80) AND (IOGAño <= 99) THEN IOGLinConcil."Fecha registro" := DMY2DATE (IOGDia, IOGMes, IOGAño + 1900) ELSE IOGLinConcil."Fecha registro" := DMY2DATE (IOGDia, IOGMes, IOGAño + 2000); IOGLinConcil."Nº documento" := COPYSTR (IOGCadena, 43, 10); IOGLinConcil.Descripción := COPYSTR (IOGCadena, 23, 5); IOGLinConcil."Cód. banco" := IOGCodBanco; IOGLinConcil.INSERT; IOGContador := IOGContador + 10000; IOGLinConcilAnterior :=IOGLinConcil; END; IF IOGTipoLinia = '23' THEN BEGIN IF IOGLinConcilAnterior.GET(IOGLinConcilAnterior."Nº línea") THEN BEGIN IOGLinConcilAnterior.Descripción := IOGConcepte; IOGLinConcilAnterior.MODIFY; END; END;
0
Comments
-
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Problem is that XMLPort is working as dataport only when started from RTC. If you are using classic client, you need to use dataport...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