public override void Reload()
        {
            Fields.Clear();

            EECWriterSettings writerSettings = (EECWriterSettings)control.ExportDestinationSettings;

            SIEEFieldlist fieldlist = writerSettings.CreateSchema();

            if (fieldlist == null)
            {
                throw (new Exception("No valid definition to create schema"));
            }

            foreach (SIEEField field in fieldlist)
            {
                if (field is SIEETableField)
                {
                    CustomExportDestinationTable newTable = new CustomExportDestinationTable(field.Name);
                    newTable.ExternalId = field.ExternalId;
                    foreach (SIEEField columnField in ((SIEETableField)field).Columns)
                    {
                        CustomExportDestinationField newCol = new CustomExportDestinationField(columnField.Name);
                        newCol.ExternalId = columnField.ExternalId;
                        newTable.Fields.Add(newCol);
                    }
                    Fields.Add(newTable);
                }
                else
                {
                    CustomExportDestinationField newField = new CustomExportDestinationField(field.Name);
                    newField.ExternalId = field.ExternalId;
                    Fields.Add(newField);
                }
            }
        }
        private void setFieldValue(SIEEFieldlist fieldlist, Field dataPoolField)
        {
            // Get field mapping. Normally the field is mapped by OCC.
            // For unit test it may also be set by FieldMapping4UnitTest
            CustomExportDestinationField edf = null;

            if (FieldMapping4UnitTest_Contains(dataPoolField.Name))
            {
                edf = new CustomExportDestinationField()
                {
                    Name = dataPoolField.Name
                }
            }
            ;
            else
            {
                edf = this.writerSettings.FieldsMapper.GetExternalField(dataPoolField);
            }

            if (edf == null)
            {
                return;
            }

            SIEEField field = fieldlist.GetFieldByName(edf.Name);

            if (field == null)
            {
                return;
            }
            field.Value = dataPoolField.Value;
            if (field.Cardinality != 0)
            {
                int cnt = 0;
                foreach (IField f in dataPoolField.Fields)
                {
                    if (field.Cardinality < 0 || cnt++ < field.Cardinality) // Cardinality < 0: infinite
                    {
                        field.ValueList.Add(f.Value);
                    }
                }

                if (field.Cardinality > 0 && dataPoolField.Fields.Count > field.Cardinality)
                {
                    SIEEExport.Trace.WriteError(
                        "Value list truncated. Field=" + edf.Name +
                        " Cardinality=" + field.Cardinality +
                        " FieldCcount=" + dataPoolField.Fields.Count
                        );
                }
            }
        }