Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IC locational Details Export

Status
Not open for further replies.

muhaidib

Programmer
Sep 27, 2005
82
SA
Dear Friends,
I am using following code to export data from IC locational details:
ICExport.Open CompDBLink
ICExport.SetView "IC0290", "", VIEW_SET, Null
ICExport.ExecuteExportScript "c:\a.xml", ReturnValue

My queries are:
1. How can I edit a.xml in case there is change in path of output file.

2. Is there any way to avoid using .xml file for doing export of all or partial data.

Kindly help with clue with coding.

Thanks in advance.
Muhaidib

**************** a.xml *******************************
<?xml version="1.0" encoding="utf-8" ?>
- <AccpacImpExp Action="3" ProgramName="IC1130" Type="EXPORT" Version="513">
- <VIEW ID="IC0290" Type="5" Action="0" AllFieldSelected="1">
<Criteria>( ITEMNO = "11100005" )</Criteria>
<TABLE>Location_Details</TABLE>
</VIEW>
<DBNAME>D:\IC2007\StdCst.xls</DBNAME>
<DBTYPE>Excel 2000</DBTYPE>
</AccpacImpExp>
 
1. Use any text editor, like Notepad or Textpad.
2. Use Excel, CSV, or Access. Accpac lets you export in many formats.

Better yet, code the extraction yourself, it's just a bunch of .Fetches, writing to a TextStream or ADO object.
 
Tuba2007,
Thanks for reply.
1. I could edit the .xml file with notepad.

2. I am exporting IC locational details to .xls file and using a.xml file as script to guide the export. As mentioned in my mail I am using code as-

"ICExport.ExecuteExportScript "c:\a.xml", ReturnValue".

My interest was to know that whether the script file should necessary be .xml file or even the .txt file is accepted.

I experimented with .txt file for script. It worked successfully.
Muhaidib
 
If you want to use the .ExecuteExportScript and .ExecuteImport Script methods, then yes, you have to use XML. Whenever I do this and need to change the contents of the XML file, I create my own file in code using the Microsoft FileSystem object.
 
tuba2007,
Creating a script file using MS FileSystem object is good idea. But it seems that the script file need not be .xml file, as now my code is as follows:

ICExport.SetView "IC0290", "", VIEW_SET, Null
'' ICExport.ExecuteExportScript "c:\a.xml", ReturnValue
ICExport.ExecuteExportScript "c:\a.txt", ReturnValue

and the a.txt file is as follows:

<?xml version="1.0" encoding="utf-8"?>
<AccpacImpExp Action="3" ProgramName="IC1130" Type="EXPORT" Version="513"><VIEW ID="IC0290" Type="5" Action="0" AllFieldSelected="1"><Criteria> ( ITEMNO &lt;= "11119999" ) </Criteria><TABLE>Location_Details</TABLE></VIEW><DBNAME>D:\IC2007\stdCst.xls</DBNAME><DBTYPE>Excel 2000</DBTYPE></AccpacImpExp>

First line of the script:
<?xml version="1.0" encoding="utf-8"?>
makes all the difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top