yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method Export (
  Key exportID_i,
  LibCal_Calendars calendars_i
)
{
  Description:
  [*
    This method is meant to be called from the UI.
    Only the client that recognizes the exportID_i that it has passed in will retrieve the ExportData.
  *]
  TextBody:
  [*
    // Trigger the export of the calendars using a temporary dataset.
    tempDataset := LibCal_ImportExportDataset::CreateTemporaryDataset( "" );  // Don't care about the name.
    exportData  := tempDataset->Export( calendars_i, true );  // Export for UI
    
    // Store the data in an attribute that is 'monitored' in the Client.
    // Setting the attribute will trigger the Client to write the data to file.
    // Setting is done via a reactive call in order to capture the BinaryValue from the stream that is returned by Export.
    this->SetExportData( exportID_i, exportData );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}