limj
2023-10-24 93652435728de839582440eefd5122c281181d35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Quintiq file version 2.0
#parent: #root
Method DownloadExcelFile (BinaryValue binaryvalue_i, String brokername_i) id:Method_LibSOPImpExp_DialogExcelExport_DownloadExcelFile
{
  #keys: '[144528.1.247478635]'
  Body:
  [*
    // Download Excel file on client based on binary value of Excel generated from server
    // and using the broker to infer the Excel filename to create
    
    // Get the Excel filename to create
    broker := select( Domain, EDIDefinitionManager.BrokerDefinitions, broker, broker.Name() = brokername_i );
    filename := broker.Destination().astype( EDIXLSLinkDefinition ).FileName()
    
    // Binary value of the Excel generated from server
    binarydata := binaryvalue_i.AsBinaryData();
    
    filepath := filename + ".xlsx";
    Application.Download( filepath, binarydata );
  *]
}