how to import/export csv files in the RTC

Can anybody explain how to import/export csv files in the RTC.

I know that I should use XMLports to do that. I have tried with an example, but didn’t work.

You probably need to explain what error you are getting using the XML port.

ups, sorry. I don’t know what I was thinking yesterday.

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.

I would recommend looking at standard XML port 5050. This is a text import export object

yep, I did that, and I have set the same properties in my XMLport.

I test the xmlport in classic client to see if it exports 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;

but the data in csv file has xml format.

It works, thanx.

I made big mistake by testing the XMLport from CC, which was very stypid of me.

But from RTC XMLport acts as dataport.

Thanx again for your assistance

Hi Maris,

Just wondering if the Import side to your XMLPort worked? I’ve followed this thread and created a simple import/export XMLPort for a .csv file also. The export works fine when run through the RTC. However, trying to import the same file back doesn’t work, plus it deletes all the content from the .csv file each time??

Any idea’s?

I am sorry but I have no idea. My import/export worked fine.

Polonious,

Just quick guess:
when you exported first, and immediately tried to import back the same data, maybe you simply got PrimaryKey violation, as these records already exist in table? Which table you played with?

Thanks guys. Sorted it out. Dumbass that I am, I fell into the oul copy & paste trap. I had File.Create(…) for my import, instead of File.Open(…) !

Thanks again.

Are you Mark Kinsella? Is that related to this one? https://community.dynamics.com/forums/t/19789.aspx

There is a problem using XMLport with Application Server. It behaves like CC and the file format will be xml.

Our accountant is asking to have and XMLport setup to allow him to import data, where do I start to create the XMLport in RTC. I have setup a dataport in classic for him, but he is having issues. Would like to use RTC, but need some guidance on where to start. I feel confident on building it, but again, confused on where to start.

Hello all,

Is there any idea on importing it looks like: if any record get problem on importing just escape that record and other records are imported on the system.

http://msdn.microsoft.com/en-us/library/dd338846.aspx

http://msdn.microsoft.com/en-us/library/dd354947.aspx

I know this post is old, but I’m running into the issue now and haven’t found a work around yet. Can you tell me whether or not this was fixed or if you found a workaround?

Thanks so much!!

Susan