Quintiq file version 2.0
#parent: pOperaction/bDownload
Response OnClick () id:Response_PanelOperation_568_bDownload_OnClick
{
  #keys: '[412672.1.106502002]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    flag := true;
    feedback := ""; 
    if( dhXMLDataListener.Data().Size() = 0 ){
      flag := false;
      feedback := "当前无下载数据，点击导出创建下载数据。"
    }
    return flag;
  *]
  QuillAction
  {
    Body:
    [*
      traverse( dhXMLDataListener.Data(),Elements,element ){
        binaryValue := element.Export();
      
        Application.Download( element.Name() + "_" + DateTime::Now().Format( "YM2D2H2mmss" ) + ".xlsx", binaryValue.AsBinaryData() );
      
        element.Delete();
      }
    *]
    GroupServerCalls: false
  }
}
