cancel
Showing results for 
Search instead for 
Did you mean: 

Export objects

Former Member
0 Kudos

I'm developing my own tool (using c#.net) in order to export User Tables, UDO and reports from a company to another. Now I would like to add a new option into my tool which allows the user to export the company's objects into xml files.

I just tried using something like the following:

myUserTable.SaveXml(ref thePath);

but the created file contains just the following:

<?xml version="1.0" encoding="UTF-16"?><BOM><BO><AdmInfo><Object>-3</Object></AdmInfo><DSLAT/></BO></BOM>

where DSLAT is my user table.

Any suggestions?

Thanks in advance,

Piero Cannizzaro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello.

I had the same problem.

I solve it like this:

You must set the XmlExportType in CompanyObject to xet_ExportImportMode.

Then I used RecordSet (MyRecordSet).

Query it with my table and all the fields:


"select * from [table]"; (C++)
"select * from [@DSLAT]"; 

And then I set the object that i wanted to export recordset, like this:


Object->Browser->RecordSet = MyRecordSet; (C++)

Next export to xml field by field, moving object->browser to next record.

This is code (in C++):


_bstr_t Path;
int PathNumber=1;
Path= (_bstr_t)"MyPath";

while (Object->GetEof()!=VARIANT_TRUE)
{
    Path+=(_bstr_t)PathNumer)
    Object->SaveXml(&(Path.GetBSTR()));
    ++PathNumber;             <- PathNumber=PathNumber+1
    Object->Browser->MoveNext();
}

This solved my problem.

Hope it helps.

Sorry for my english.

Regards

Kamil Wydra

Answers (0)