lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Quintiq file version 2.0
#parent: #root
Method WriteToDestinationFile (
  String exportpath,
  structured[BinaryValue] binaryvalues,
  structured[String] brokernames
) id:Method_DialogEDIExportDEV_WriteToDestinationFile
{
  #keys: '[132680.0.795583]'
  Body:
  [*
    // Write the binary data of the respective 
    // file to its export destination
    i := 0;
    
    traverse( brokernames, Elements, brokername )
    {
      broker := select( Domain, EDIDefinitionManager.BrokerDefinitions, broker, broker.Name() = brokername );
      filename := broker.Destination().astype( EDIXLSLinkDefinition ).FileName() 
    
    
      binarydata := binaryvalues.Element( i ).AsBinaryData();
    
      filepath := exportpath  + "/" + filename + ".xlsx"
      Application.WriteBinaryFile( filepath, binarydata );
      i :=i+1;
    
    }
  *]
}