Hi,
I have created a XMLport that can import and export records in text. The XMLport is being called from a report by .export or .import.
I have few different tables in the xmlport, but some of the tables might have empty record, so I need to insert empty line to the text file if the table is empty during Export (it does in dataport). Otherwise during Import, if the empty line does not exist, the XMLport will read the wrong record/text from the file.
Any idea how to insert the empty line to represent the record is empty? Like it does in dataport? :-k
0
Comments
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
Thanks for your reply.
Yea, it only exports the element if the Format is XML, but i need to export text instead .
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
I have already tried to use temp record and insert an empty record to the temp table before export, so the text result is:
1st record xxxxxx
2nd record yyyyy
,,0.00,,
4th record zzzzz
But is it possible to get a total empty line instead? For example:
1st record xxxxxx
2nd record yyyyy
4th record zzzzzz
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
Hmm... I am not sure if we are thinking the same approach? I have make a simple XMLport (as shown below) to try on as my original xmlport has too many tables.
on my XMLport:
Node Name Node Type Source Type Data Source
Root Element Text <Root>
Customer Element Table <Customer>(Customer)
no Element Field Customer::No.
name Element Field Customer::Name
ReasonCode Element Table <Reason Code>(Reason Code)
code Element Field Reason Code::Code
description Element Field Reason Code::Description
amt Element Field Reason Code::Contract Gain/Loss Amount
I have set the table as Temporary.
On each table Export::OnPreXMLItem(), i insert an empty record to the temp table:
IF gReasonCode.ISEMPTY THEN BEGIN
"Reason Code".INIT;
"Reason Code".INSERT;
END;
and i call this xmlport from a report by using xmlport.export
So how do you write the empty line?
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com