对比新文件 |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod AwaitLocalTableXMLData ( |
| | | const Strings columnXMLData, |
| | | RecycleBin owner, |
| | | String tableName, |
| | | String sheetName |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // rislai Jun-21-2024 (created) |
| | | manager := select( owner,ExportXMLManager,manager,manager.Name() = tableName ); |
| | | if( not isnull( manager )){ |
| | | manager.Delete(); |
| | | } |
| | | manager := owner.ExportXMLManager( relnew,Name := tableName,SheetName := sheetName ); |
| | | traverse( columnXMLData,Elements,element,element.TrimBoth() <> "" ){ |
| | | data := manager.ExportXMLData( relnew, XML := element); |
| | | try{ |
| | | data.Priority( data.CalculatePriority( )); |
| | | }onerror{ |
| | | info( element ); |
| | | } |
| | | } |
| | | *] |
| | | } |
| | |
| | | columnstring := columnstring.Merge( cellxml); |
| | | } |
| | | |
| | | columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,guard( rows.Element(0).LocalTable().Name(),LocalCell_DemandComparison::GetTableName()) ); |
| | | columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,LocalCell_DemandComparison::GetTableName(),guard( rows.Element(0).LocalTable().Name(),"") ); |
| | | *] |
| | | } |
| | |
| | | columns := construct( LocalColumns ); |
| | | LocalCell_DemandComparison::GenerateColumnIndex( baseVersionTable,localTable,columnTree,columns ); |
| | | LocalCell_DemandComparison::GenerateColumnIndex( compareVersionTable,localTable,columnTree,columns ); |
| | | columnNames := selectvalues( columns,Elements,column,true,column.Name() ); |
| | | columnNames := selectvalues( columns,Elements,column,true,column.CustomName()); |
| | | |
| | | // 鐢熸垚鏁版嵁 |
| | | for ( rowIndex := 0; rowIndex < rowKeys.Size(); rowIndex++ ) { |
| | |
| | | |
| | | row := localTable.LocalRow( relnew,Index := localTable.GetRowIndexCache() ); |
| | | |
| | | traverse( columnNames,Elements,columnName ){ |
| | | traverse( columnNames,Elements,columnName ,columnName <> "" ){ |
| | | columnHandle := columnTree.GetHandle( columnName ); |
| | | columnIndex := columnTree.Root().Child( columnHandle ).GetValueAsNumber(); |
| | | column := columns.Element( columnIndex ); |
| | | columnIndex := guard( columnTree.Root().Child( columnHandle ) , null( NamedValue )); |
| | | column := null( LocalColumn ); |
| | | if( not isnull( columnIndex )){ |
| | | column := columns.Element( columnIndex.GetValueAsNumber() ); |
| | | } |
| | | if( isnull( column )){ |
| | | error( columnName + " is null." ); |
| | | } |
| | | |
| | | baseVersionCell := constnull( GeneralExcelImportAndExportDataCell ); |
| | | baseVersionCellHandle := baseVersionCellTree.GetHandle( columnName ); |
| | | try{ |
| | | baseVersionCellIndex := baseVersionCellTree.Root().Child( baseVersionCellHandle ).GetValueAsNumber(); |
| | | baseVersionCell := baseVersionCells.Element( baseVersionCellIndex ); |
| | | }onerror{} |
| | | baseVersionCellIndex := guard( baseVersionCellTree.Root().Child( baseVersionCellHandle ),null( NamedValue )); |
| | | if( not isnull( baseVersionCellIndex )){ |
| | | baseVersionCell := baseVersionCells.Element( baseVersionCellIndex.GetValueAsNumber() ); |
| | | } |
| | | |
| | | compareVersionCell := constnull( GeneralExcelImportAndExportDataCell ); |
| | | compareVersionCellHandle := compareVersionCellTree.GetHandle( columnName ); |
| | | try{ |
| | | compareVersionCellIndex := compareVersionCellTree.Root().Child( compareVersionCellHandle ).GetValueAsNumber(); |
| | | compareVersionCell := compareVersionCells.Element( compareVersionCellIndex ); |
| | | }onerror{} |
| | | compareVersionCellIndex := guard( compareVersionCellTree.Root().Child( compareVersionCellHandle ),null( NamedValue )); |
| | | if( not isnull( compareVersionCellIndex )){ |
| | | compareVersionCell := compareVersionCells.Element( compareVersionCellIndex.GetValueAsNumber() ); |
| | | } |
| | | |
| | | if( columnName = "浜у湴" or columnName = "杞﹀瀷" or columnName = "鍙戝姩鏈洪浂浠跺彿" or columnName = "鍙戝姩鏈哄洓浣嶇爜" ){ |
| | | row.LocalCell( relnew,LocalCell_DemandComparison,LocalColumn := column, |
| | |
| | | if( not isnull( compareVersionFile )){ |
| | | compareVersionFile.Close(); |
| | | } |
| | | error( e ); |
| | | error( e.GeneralInformation() ); |
| | | } |
| | | |
| | | return localTable; |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | rows := selectset( dhComparisonData.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,product,product.ID() = row.Name() ) ); |
| | | rows := selectset( dhComparisonData.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,product,product.ID() = row.ProductID())); |
| | | columns := selectset( dhComparisonData.Data( ),LocalColumn,column,not column.IsAttrbuteColumn() and dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() ); |
| | | LocalCell_DemandComparison::AsyncExport( RecycleBin, rows, columns ,MacroPlan ); |
| | | *] |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | if( not isnull( dhXMLDataListener.Data() )){ |
| | | binaryValue := dhXMLDataListener.Data( ).Export(); |
| | | |
| | | Application.Download( LocalCell_DemandComparison::GetTableName() + "_" + DateTime::Now().Format( "YM2D2H2mmss" ) + ".xlsx", binaryValue.AsBinaryData() ); |
| | | |
| | | Application.Download( dhXMLDataListener.Data().SheetName() + "_" + DateTime::Now().Format( "YM2D2H2mmss" ) + ".xlsx", binaryValue.AsBinaryData() ); |
| | | dhXMLDataListener.Data( ).Delete(); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |