Can anyone tell me how to import/export csv files in the RTC.
I know that I have to use XMLport, and I have tried but it's not working.
Can you please explain how to do this properly, or give an example.
What does it mean "and I have tried but it's not working"? Some errors? Or you do not know how to run the XMLPort? Is the file you want to import on the service tier machine?
The XMLPort itself have no request form. You need to call it through XMLPORT.IMPORT or XMLPORT.EXPORT where you are passing the InStream or OutStream to the file you want to use.
I did this but the data in csv file is in xml format. I thought that I would get csv file.
IF ISCLEAR(FileSystem) THEN
CREATE(FileSystem);
FilePath := 'C:\';
IF NOT FileSystem.FolderExists(FilePath) THEN
FileSystem.CreateFolder(FilePath);
IF EXISTS(FilePath + 'PostCode.csv') THEN
ERASE(FilePath + 'PostCode.csv');
TestFile.CREATE(FilePath + 'PostCode.csv');
TestFile.CREATEOUTSTREAM(TestStream);
XMLPORT.EXPORT(50000, TestStream);
TestFile.CLOSE;
By the way I am testing xmlport on classic client just to see if it works as supposed to(exporting csv file), but it is not.
and format property is set to variable text.
I am afraid that the XMLPort as Dataport behave only when running on Service tier, it means when it is started from RTC. For CC you still need to use dataports (but this is just my expectation right now).
Kine you have right.
thank you:)
It works from rtc.
I don't know why in the world I didn test from CC first. this was very stypid of me.
tanx again, tankt you all.
I love Mibuso :P
Hi all,
I am facing the same problem which is as follows:
I want to import data in RTC using XML Port. For that I want to use either CSV file or Excel File.Using CSV File I am not able to import data in RTC.
How can I import Data in RTC from Excel or CSV file ? (If Possible then Please Provide me example)
Is there any other option to Import data in RTC ?
Please Guide me.
hi, trying to use Maris' code above but NAV doesn't recognize "filesystem." How does that need to be initialized? It appears to want an automation object...
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Well, first of all I am just trying with a very simple exsample for exercise.
I have created XMLport based on "Post Code" table, and I need I to work both ways(import/export).
The XMLport should export/import data as csv file.
I have changed the Format property to "Variable Text" and when I run the XMLport data is exported in XML format.
I don't know how to make the XMLport to act as dataport.
Do I have to change some other properties or add some code to XMLport?
I was searching the web for an example or an explanation on this, but could find anything.
Would you be kind enough to explain me what I am doing wrong or maybe give an example.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
2) Are you trying it from CC or RTC?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
and format property is set to variable text.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I thougt that if format property is set to variable text, XMLport would act as dataport on CC too. :oops:
thank you:)
It works from rtc.
I don't know why in the world I didn test from CC first. this was very stypid of me.
tanx again, tankt you all.
I love Mibuso :P
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I am facing the same problem which is as follows:
I want to import data in RTC using XML Port. For that I want to use either CSV file or Excel File.Using CSV File I am not able to import data in RTC.
How can I import Data in RTC from Excel or CSV file ? (If Possible then Please Provide me example)
Is there any other option to Import data in RTC ?
Please Guide me.
With Best Regards
Dipak Patel
Thanks,
Chandler