Article: Setting The Output File

Index

Setting The Output File

Creating an EDI document is easy with the EDIDocument component. The EDIDocument component contains a constructor that accepts a path to a file to create. EDIDocument will create the file when generating EDI content.

Example

// Instantiate an instance of EDIDocument and set the filestream parameter
EDIDocument sampleEDIFile = new EDIDocument(“C:\edi.txt”);

// Create an interchange loop. This loop will contain all other loops in the EDI structure
Loop interchangeHeaderLoop = new Loop(Interchange Header”);

// Add the interchange loop to the EDI document
sampleEDIFile.Loops.Add(interchangeHeaderLoop);

// Generate the EDI file
sampleEDIFile.GenerateEDIFile();
You can also set the EDIFilePath property of EDIDocument before calling the GenerateEDIFile() method.

Related Articles

Main Categories