From b0fcdca488f07cc3c69ad2266cab5815c0ee4526 Mon Sep 17 00:00:00 2001
From: rislai <risheng.lai@capgemini.com>
Date: 星期五, 28 六月 2024 23:28:41 +0800
Subject: [PATCH] 添加需求对比过滤器

---
 _Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl                                                                       |    9 
 _Main/BL/Type_ExportXMLManager/Attribute_SheetName.qbl                                                                                      |    7 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListCompareVersionPP_OnSelectionChanged.def        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick#723.def                              |    6 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelOperation#568.def                                                 |   49 ----
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_pVersionInfomation.def                                                 |   53 ++++
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedSalesSegment_OnDataChanged.def           |   21 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListCompareVersionPR_OnSelectionChanged#599.def    |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DropDownListBaseVersionIDS_OnSelectionChanged.def         |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListBaseVersionPPA_OnSelectionChanged.def         |    2 
 _Main/BL/Type_ExportXMLManager/Method_Export.qbl                                                                                            |    9 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListBaseVersionPP_OnSelectionChanged.def           |    2 
 _Main/BL/Type_ExportXMLManager/Function_CalcFinalXML.qbl                                                                                    |    2 
 _Main/BL/Type_Test/StaticMethod_Test.qbl                                                                                                    |   23 -
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhFinelProduct_OnCreated.def                      |   16 +
 _Main/BL/Type_ExportXMLManager/StaticMethod_AwaitShiftPlanXMLData.qbl                                                                       |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListBaseVersionBudget_OnSelectionChanged.def   |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DataExtractorOperationIDS_OnSelectionChanged.def          |    2 
 _Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData.qbl                                                                      |    5 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsEndDate_OnChanged.def                                     |   16 +
 _Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl                                                                          |    6 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListBaseVersionCurve_OnSelectionChanged.def     |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslPower_OnCreated.def                                     |   20 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListCompareVersionCurve_OnSelectionChanged.def  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsStartDate_OnChanged.def                                   |   16 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslGeneration_OnCreated.def                                |   20 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListCompareVersionBudget_OnSelectionChange.def |    2 
 _Main/BL/Type_LocalColumn/Attribute_Date.qbl                                                                                                |    7 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhStartDate_OnCreated.def                                   |   16 +
 _Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl                                                                      |   45 +++
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_ButtonCompare_OnClick.def                            |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedProduct_OnDataChanged.def                |   20 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison.def                                              |   60 +++++
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslMQBMLB_OnCreated.def                                    |   20 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhEndDate_OnCreated.def                                     |   16 +
 _Main/BL/Type_LocalColumn/Function_CalcDate.qbl                                                                                             |   13 +
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListBaseVersionPR_OnSelectionChanged#98.def        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison294.def                                           |    1 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ButtonFilter_OnClick.def                                    |   26 ++
 _Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetAttributeNames.qbl                                                                 |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_MatrixEditor.def                                                       |    6 
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelFilter.def                                                        |   96 ++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListCompareVersionPPA_OnSelectionChanged.def      |    2 
 43 files changed, 537 insertions(+), 97 deletions(-)

diff --git a/_Main/BL/Type_ExportXMLManager/Attribute_SheetName.qbl b/_Main/BL/Type_ExportXMLManager/Attribute_SheetName.qbl
new file mode 100644
index 0000000..9731693
--- /dev/null
+++ b/_Main/BL/Type_ExportXMLManager/Attribute_SheetName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute SheetName
+{
+  #keys: '3[412672.0.1121446115][412672.0.1121446114][412672.0.1121446116]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_ExportXMLManager/Function_CalcFinalXML.qbl b/_Main/BL/Type_ExportXMLManager/Function_CalcFinalXML.qbl
index 3b9cd77..0f9c6bf 100644
--- a/_Main/BL/Type_ExportXMLManager/Function_CalcFinalXML.qbl
+++ b/_Main/BL/Type_ExportXMLManager/Function_CalcFinalXML.qbl
@@ -5,7 +5,7 @@
   TextBody:
   [*
     // rislai Jun-20-2024 (created)
-    xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?><table><name>'+ this.Name() +'</name>';
+    xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?><table><name>'+ this.SheetName() +'</name>';
     
     datas := selectsortedset( this,ExportXMLData,data,true,data.Priority() );
     
diff --git a/_Main/BL/Type_ExportXMLManager/Method_Export.qbl b/_Main/BL/Type_ExportXMLManager/Method_Export.qbl
index 76e648d..c8ae706 100644
--- a/_Main/BL/Type_ExportXMLManager/Method_Export.qbl
+++ b/_Main/BL/Type_ExportXMLManager/Method_Export.qbl
@@ -6,10 +6,15 @@
   [*
     // rislai Jun-21-2024 (created)
     tableGroupHandle := TableGroupHandle::Create( "tableGroupHandle" );
-    tableHandle := TableHandle::ImportXML( BinaryValue::Construct( this.FinalXML() ) );
+    tableHandle := null( TableHandle );
+    try{
+      tableHandle := TableHandle::ImportXML( BinaryValue::Construct( this.FinalXML()));
+    }onerror{
+      this.Delete();
+      error( e );
+    }
     tableGroupHandle.Add( tableHandle );
     binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true );
-     
     return binaryData.AsBinaryValue();
   *]
 }
diff --git a/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData.qbl b/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData.qbl
index fdde1b7..1acc8ee 100644
--- a/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData.qbl
+++ b/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData.qbl
@@ -2,7 +2,8 @@
 #parent: #root
 StaticMethod AwaitLocalTableXMLData (
   const Strings columnXMLData,
-  RecycleBin owner
+  RecycleBin owner,
+  String tableName
 )
 {
   TextBody:
@@ -10,7 +11,7 @@
     // rislai Jun-21-2024 (created)
     manager := select( owner,ExportXMLManager,manager,manager.Name() = "LocalTableXML" );
     if( isnull( manager )){
-      manager := owner.ExportXMLManager( relnew,Name := "LocalTableXML" );
+      manager := owner.ExportXMLManager( relnew,Name := "LocalTableXML",SheetName := tableName );
     }else{
       manager.ExportXMLData( relflush );
     }
diff --git a/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitShiftPlanXMLData.qbl b/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitShiftPlanXMLData.qbl
index fc5bb88..f8f7792 100644
--- a/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitShiftPlanXMLData.qbl
+++ b/_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitShiftPlanXMLData.qbl
@@ -10,7 +10,7 @@
     // rislai Jun-20-2024 (created)
     manager := select( owner,ExportXMLManager,manager,manager.Name() = "ShiftPlanXML" );
     if( isnull( manager )){
-      manager := owner.ExportXMLManager( relnew,Name := "ShiftPlanXML" );
+      manager := owner.ExportXMLManager( relnew,Name := "ShiftPlanXML",SheetName := "Shift plan" );
     }else{
       manager.ExportXMLData( relflush );
     }
diff --git a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl
index 4364350..d19420b 100644
--- a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl
+++ b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl
@@ -3,7 +3,8 @@
 StaticMethod AsyncExport (
   RecycleBin recycleBin,
   const constcontent LocalRows rows,
-  const constcontent LocalColumns columns
+  const constcontent LocalColumns columns,
+  const MacroPlan macroPlan
 )
 {
   TextBody:
@@ -17,15 +18,15 @@
     flag := true;
     traverse( sortColumns,Elements,sortColumn ){
       if( flag ){
-        attributeXML := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames,"attribute" );
+        attributeXML := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames,"attribute",macroPlan );
         columnstring := columnstring.Merge( attributeXML )
         flag := false;
       }
       
-      cellxml := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames ,"data");
+      cellxml := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames ,"data",macroPlan );
       columnstring := columnstring.Merge( cellxml);
     }
      
-    columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin );
+    columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,guard( rows.Element(0).LocalTable().Name(),"Sheet1") );
   *]
 }
diff --git a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
index d7d8942..3c0055a 100644
--- a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
+++ b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
@@ -3,13 +3,15 @@
 StaticMethod Compared (
   RecycleBin recycleBin,
   String baseVersionPath,
-  String compareVersionPath
+  String compareVersionPath,
+  String baseVersionName,
+  String compareVersionName
 ) as LocalTable
 {
   TextBody:
   [*
     // rislai Jun-20-2024 (created)
-    localTable := recycleBin.LocalTable( relnew,Name := baseVersionPath + "__" + compareVersionPath);
+    localTable := recycleBin.LocalTable( relnew,Name := baseVersionName + "__" + compareVersionName );
     
     baseVersionFile := OSFile::Construct();
     compareVersionFile := OSFile::Construct();
diff --git a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetAttributeNames.qbl b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetAttributeNames.qbl
index c766db0..1072935 100644
--- a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetAttributeNames.qbl
+++ b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetAttributeNames.qbl
@@ -7,8 +7,6 @@
     // rislai Jun-21-2024 (created)
     attributeNames := construct( Strings );
     
-    attributeNames.Add( "BaseVersionValue" );
-    attributeNames.Add( "CompareVersionValue" );
     attributeNames.Add( "BaseVersion" );
     attributeNames.Add( "CompareVersion" );
     attributeNames.Add( "Gap" );
diff --git a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl
index 308ed41..6d45dc4 100644
--- a/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl
+++ b/_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl
@@ -4,7 +4,8 @@
   const constcontent LocalRows rows,
   const LocalColumn column,
   const Strings attributeNames,
-  String type
+  String type,
+  const MacroPlan macroPlan
 ) const as String
 {
   TextBody:
@@ -30,6 +31,11 @@
       columnXML := columnXML + "</column>";
     }
     if( type = "attribute" ){
+      columnXML0_1 := "<column><name>Sales Segment</name><type>String</type>";
+      columnXML0_2 := "<column><name>Generation</name><type>String</type>";
+      columnXML0_3 := "<column><name>MQB/MLB</name><type>String</type>";
+      columnXML0_4 := "<column><name>鍔熺巼</name><type>String</type>";
+      
       columnXML1 := "<column><name>Product ID</name><type>String</type>";
       columnXML2 := "<column><name>Attribute</name><type>String</type>";
       
@@ -39,16 +45,51 @@
           if( flag ){
             cellXML := '<cell value="' + cell.LocalRow().Name() + '"/>'
             columnXML1 := columnXML1 + cellXML;
+            
+            salesSegment := select( cell.LocalRow().LocalTable(),LocalColumn.LocalCell.astype( LocalCell_DemandComparison ),temp_cell,temp_cell.LocalRow() = cell.LocalRow() and temp_cell.LocalColumn().Name() = "浜у湴");
+            if( not isnull( salesSegment )){
+              cellXML0_1 := '<cell value="' + ifexpr( salesSegment.BaseVersionValue() <> "绌�",salesSegment.BaseVersionValue(),salesSegment.CompareVersionValue()) + '"/>';
+              columnXML0_1 := columnXML0_1 + cellXML0_1;
+            }else{
+              cellXML0_1 := '<cell value="  "/>'
+              columnXML0_1 := columnXML0_1 + cellXML0_1;
+            }
+            
+            product := select( macroPlan,Product_MP,product,product.ID() = cell.LocalRow().Name() );
+            if( not isnull( product )){
+              cellXML0_2 := '<cell value="' + product.Generation() + '"/>';
+              cellXML0_3 := '<cell value="' + product.MQBMLB() + '"/>';
+              cellXML0_4 := '<cell value="' + product.Power() + '"/>';
+              columnXML0_2 := columnXML0_2 + cellXML0_2;
+              columnXML0_3 := columnXML0_3 + cellXML0_3;
+              columnXML0_4 := columnXML0_4 + cellXML0_4;
+            }else{
+              cellXML0_2 := '<cell value="  "/>';
+              cellXML0_3 := '<cell value="  "/>';
+              cellXML0_4 := '<cell value="  "/>';
+              columnXML0_2 := columnXML0_2 + cellXML0_2;
+              columnXML0_3 := columnXML0_3 + cellXML0_3;
+              columnXML0_4 := columnXML0_4 + cellXML0_4;
+            }
+            
             flag := false;
           }else{
             cellXML := '<cell value="  "/>'
             columnXML1 := columnXML1 + cellXML;
+            cellXML0_1 := '<cell value="  "/>'
+            cellXML0_2 := '<cell value="  "/>';
+            cellXML0_3 := '<cell value="  "/>';
+            cellXML0_4 := '<cell value="  "/>';
+            columnXML0_1 := columnXML0_1 + cellXML0_1;
+            columnXML0_2 := columnXML0_2 + cellXML0_2;
+            columnXML0_3 := columnXML0_3 + cellXML0_3;
+            columnXML0_4 := columnXML0_4 + cellXML0_4;
           }
           cellXML := '<cell value="' + e + '"/>'
           columnXML2 := columnXML2 + cellXML;
         }
       }
-      columnXML := columnXML1 + "</column>" + columnXML2 + "</column>";
+      columnXML := columnXML0_1 + "</column>" + columnXML0_2 + "</column>" + columnXML0_3 + "</column>" + columnXML0_4 + "</column>" + columnXML1 + "</column>" + columnXML2 + "</column>";
     }
      
     return columnXML;
diff --git a/_Main/BL/Type_LocalColumn/Attribute_Date.qbl b/_Main/BL/Type_LocalColumn/Attribute_Date.qbl
new file mode 100644
index 0000000..9b0c643
--- /dev/null
+++ b/_Main/BL/Type_LocalColumn/Attribute_Date.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Date
+{
+  #keys: '3[412672.0.1120948156][412672.0.1120948155][412672.0.1120948157]'
+  ValueType: Date
+}
diff --git a/_Main/BL/Type_LocalColumn/Function_CalcDate.qbl b/_Main/BL/Type_LocalColumn/Function_CalcDate.qbl
new file mode 100644
index 0000000..2e99838
--- /dev/null
+++ b/_Main/BL/Type_LocalColumn/Function_CalcDate.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcDate
+{
+  TextBody:
+  [*
+    // rislai Jun-28-2024 (created)
+    if( not this.IsAttrbuteColumn() ){
+      names := this.Name().Tokenize( "/" );
+      this.Date( guard( Date::Construct( [Number]names.Element( 0 ),[Number]names.Element( 1 ),[Number]names.Element( 2 )),Date::MinDate() ));
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Test/StaticMethod_Test.qbl b/_Main/BL/Type_Test/StaticMethod_Test.qbl
index 9d0c69d..cc86dfc 100644
--- a/_Main/BL/Type_Test/StaticMethod_Test.qbl
+++ b/_Main/BL/Type_Test/StaticMethod_Test.qbl
@@ -9,25 +9,8 @@
 {
   TextBody:
   [*
-    // rislai Jun-9-2024 (created)
-    archive.ArchivePR( relnew,Name := "PR72.SP_20240604_VWED.xlsx",FilePath := "C:\Excel\PR72.SP_20240604_VWED.xlsx");
-    
-    archive.ArchivePR( relnew,Name := "PR72.SP_20240605_VWED.xlsx",FilePath := "C:\Excel\PR72.SP_20240605_VWED.xlsx");
-    
-    
-    //testTree := NamedValueTree::Create();
-    //
-    //testTreeHandel := testTree.GetHandle( "test1" );
-    //testTreeHandel2 := testTree.GetHandle( "test2" );
-    //
-    //testTree.Root().AddChild( testTreeHandel,1 );
-    //
-    //info( testTree.Root().Child( testTreeHandel ).GetValueAsNumber() );
-    //try{
-    //  info( testTree.Root().Child( testTreeHandel2 ).GetValueAsNumber() ); 
-    //}onerror{
-    //  testTree.Root().AddChild( testTreeHandel,2 );
-    //}
-    //info( testTree.Root().Child( testTreeHandel ).GetValueAsNumber() );
+    name := "2020/04/01";
+    names := name.Tokenize( "/" );
+      info( guard( Date::Construct( [Number]names.Element( 0 ),[Number]names.Element( 1 ),[Number]names.Element( 2 )),Date::MinDate() ));
   *]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_MatrixEditor.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_MatrixEditor.def
index e22590b..df39242 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_MatrixEditor.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_MatrixEditor.def
@@ -26,7 +26,7 @@
       ]
       Properties:
       [
-        Attributes: 'BaseVersionValue;CompareVersionValue;BaseVersion;CompareVersion;Gap'
+        Attributes: 'BaseVersion;CompareVersion;Gap'
         Column: 'LocalColumn'
         Row: 'LocalRow'
         Taborder: 0
@@ -45,6 +45,8 @@
           Properties:
           [
             DataType: 'LocalTable'
+            FilterArguments: 'checkedProduct:QMacroPlanner::FormDemandComparison.dhFinelProduct'
+            FixedFilter: 'exists( checkedProduct,Elements,product,product.ID() = object.Name() )'
             Source: 'dhComparisonData'
             Taborder: 0
             Transformation: 'LocalRow'
@@ -71,6 +73,8 @@
           Properties:
           [
             DataType: 'LocalTable'
+            FilterArguments: 'startDate:QMacroPlanner::FormDemandComparison.dhStartDate;endDate:QMacroPlanner::FormDemandComparison.dhEndDate'
+            FixedFilter: 'not object.IsAttrbuteColumn() and startDate <= object.Date() and endDate > object.Date()'
             Source: 'dhComparisonData'
             Taborder: 0
             Transformation: 'LocalColumn'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison.def
index c3618ae..e6b3648 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison.def
@@ -16,6 +16,66 @@
         Taborder: 1
       ]
     }
+    Component dhCheckedProduct
+    {
+      #keys: '[412672.0.1121211408]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'structured[Product_MP]*'
+      Children:
+      [
+        Component deCheckedProduct
+        {
+          #keys: '[412672.0.1121633584]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'structured[Product_MP]'
+            Source: 'ApplicationMacroPlanner.DataHolderCheckedProduct'
+            Taborder: 0
+            Transformation: 'Elements'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Taborder: 3
+      ]
+    }
+    Component dhFinelProduct
+    {
+      #keys: '[412672.0.1121876690]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'structured[Product_MP]*'
+      Properties:
+      [
+        Taborder: 2
+      ]
+    }
+    Component dhCheckedSalesSegment
+    {
+      #keys: '[412672.0.1122338152]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'structured[SalesSegment_MP]*'
+      Children:
+      [
+        Component deCheckedSalesSegment
+        {
+          #keys: '[412672.0.1122072068]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'structured[SalesSegment_MP]'
+            Source: 'ApplicationMacroPlanner.DataHolderCheckedSalesSegment'
+            Taborder: 0
+            Transformation: 'Elements'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Taborder: 4
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison294.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison294.def
index b962093..d5ae537 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison294.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelDemandComparison294.def
@@ -7,6 +7,7 @@
   [
     #child: PanelSelection
     #child: PanelOperation_568
+    #child: PanelFilter
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelFilter.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelFilter.def
new file mode 100644
index 0000000..939065e
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelFilter.def
@@ -0,0 +1,96 @@
+Quintiq file version 2.0
+Component PanelFilter
+{
+  #keys: '[412672.0.1119852113]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component ddslGeneration
+    {
+      #keys: '[412672.0.1119852174]'
+      BaseType: 'WebDropDownStringList'
+      Properties:
+      [
+        Label: 'Generation'
+        Taborder: 0
+      ]
+    }
+    Component ddslMQBMLB
+    {
+      #keys: '[412672.0.1119852186]'
+      BaseType: 'WebDropDownStringList'
+      Properties:
+      [
+        Label: 'MQB/MLB'
+        Taborder: 1
+      ]
+    }
+    Component ddslPower
+    {
+      #keys: '[412672.0.1119852198]'
+      BaseType: 'WebDropDownStringList'
+      Properties:
+      [
+        Label: '鍔熺巼'
+        Taborder: 2
+      ]
+    }
+    Component dsStartDate
+    {
+      #keys: '[412672.0.1119852248]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        Label: 'Start Date'
+        Taborder: 3
+      ]
+    }
+    Component dsEndDate
+    {
+      #keys: '[412672.0.1119852261]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        Date: 9999-12-31
+        Label: 'End Date'
+        Taborder: 5
+      ]
+    }
+    Component ButtonFilter
+    {
+      #keys: '[412672.0.1121729150]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Label: '杩囨护'
+        Taborder: 7
+      ]
+    }
+    Component dhStartDate
+    {
+      #keys: '[412672.0.1122339350]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'Date*'
+      Properties:
+      [
+        Taborder: 4
+      ]
+    }
+    Component dhEndDate
+    {
+      #keys: '[412672.0.1122339363]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'Date*'
+      Properties:
+      [
+        Taborder: 6
+      ]
+    }
+  ]
+  Properties:
+  [
+    FixedSize: true
+    Orientation: 'horizontal'
+    Taborder: 1
+  ]
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelOperation\043568.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelOperation\043568.def"
index cfb9153..f54864f 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelOperation\043568.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_PanelOperation\043568.def"
@@ -12,47 +12,7 @@
       Properties:
       [
         Label: '寮�濮嬪姣�'
-        Taborder: 4
-      ]
-    }
-    Component efBaseVersion
-    {
-      #keys: '[412672.0.1111643258]'
-      BaseType: 'WebEditField'
-      Properties:
-      [
-        Label: '鍩哄噯闇�姹傜増鏈細'
-        Taborder: 0
-      ]
-    }
-    Component efCompareVersion
-    {
-      #keys: '[412672.0.1111643271]'
-      BaseType: 'WebEditField'
-      Properties:
-      [
-        Label: '瀵规瘮闇�姹傜増鏈細'
-        Taborder: 2
-      ]
-    }
-    Component dhCompareVersionPath
-    {
-      #keys: '[412672.0.1111643374]'
-      BaseType: 'WebDataHolder'
-      Databinding: 'String*'
-      Properties:
-      [
         Taborder: 3
-      ]
-    }
-    Component dhBaseVersionPath
-    {
-      #keys: '[412672.0.1111643396]'
-      BaseType: 'WebDataHolder'
-      Databinding: 'String*'
-      Properties:
-      [
-        Taborder: 1
       ]
     }
     Component dhXMLDataListener id:dhXMLDataListener_906
@@ -78,7 +38,7 @@
       ]
       Properties:
       [
-        Taborder: 7
+        Taborder: 2
       ]
     }
     Component bExport id:bExport_98
@@ -89,7 +49,7 @@
       [
         Image: 'EXPORT1'
         Label: '瀵煎嚭'
-        Taborder: 5
+        Taborder: 0
       ]
     }
     Component bDownload id:bDownload_352
@@ -100,13 +60,14 @@
       [
         Image: 'DOWNLOAD'
         Label: '涓嬭浇'
-        Taborder: 6
+        Taborder: 1
       ]
     }
+    #child: pVersionInfomation
   ]
   Properties:
   [
     Orientation: 'horizontal'
-    Taborder: 1
+    Taborder: 2
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_pVersionInfomation.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_pVersionInfomation.def
new file mode 100644
index 0000000..9d0dfe9
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Component_pVersionInfomation.def
@@ -0,0 +1,53 @@
+Quintiq file version 2.0
+Component pVersionInfomation
+{
+  #keys: '[412672.0.1119852729]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component dhBaseVersionPath id:dhBaseVersionPath_640
+    {
+      #keys: '[412672.0.1119852775]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'String*'
+      Properties:
+      [
+        Taborder: 2
+      ]
+    }
+    Component dhCompareVersionPath id:dhCompareVersionPath_582
+    {
+      #keys: '[412672.0.1119852802]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'String*'
+      Properties:
+      [
+        Taborder: 3
+      ]
+    }
+    Component lBaseVersionName
+    {
+      #keys: '[412672.0.1119853064]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        Label: '鍩哄噯闇�姹傜増鏈細'
+        Taborder: 0
+      ]
+    }
+    Component lCompareVersionName
+    {
+      #keys: '[412672.0.1119853066]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        Label: '瀵规瘮闇�姹傜増鏈細'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Taborder: 4
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedProduct_OnDataChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedProduct_OnDataChanged.def
new file mode 100644
index 0000000..038f6f7
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedProduct_OnDataChanged.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: PanelDemandComparison/dhCheckedProduct
+Response OnDataChanged () id:Response_PanelDemandComparison_dhCheckedProduct_OnDataChanged
+{
+  #keys: '[412672.0.1122118230]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnDataChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      if( this.Data().Size() <> 0 ){
+        dhFinelProduct.Data( this.Data().Copy() ); 
+      }else{
+        dhFinelProduct.Data( DataHolderProduct.Data().Copy() ); 
+      }
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedSalesSegment_OnDataChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedSalesSegment_OnDataChanged.def
new file mode 100644
index 0000000..1500156
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhCheckedSalesSegment_OnDataChanged.def
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: PanelDemandComparison/dhCheckedSalesSegment
+Response OnDataChanged () id:Response_PanelDemandComparison_dhCheckedSalesSegment_OnDataChanged
+{
+  #keys: '[412672.0.1122600939]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnDataChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      if( this.Data().Size() <> 0 ){
+        prods := selectset( dhFinelProduct.Data(),Elements,element,exists( this.Data(),Elements.SalesDemand.Product_MP,prod,element = prod ));
+        dhFinelProduct.Data( &prods );
+      }else{
+        dhFinelProduct.Data( DataHolderProduct.Data().Copy() );
+      }
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhFinelProduct_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhFinelProduct_OnCreated.def
new file mode 100644
index 0000000..306233c
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelDemandComparison_dhFinelProduct_OnCreated.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelDemandComparison/dhFinelProduct
+Response OnCreated () id:Response_PanelDemandComparison_dhFinelProduct_OnCreated
+{
+  #keys: '[412672.0.1122081581]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      this.Data( DataHolderProduct.Data().Copy() );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ButtonFilter_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ButtonFilter_OnClick.def
new file mode 100644
index 0000000..f0b4966
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ButtonFilter_OnClick.def
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+#parent: PanelFilter/ButtonFilter
+Response OnClick () id:Response_PanelFilter_ButtonFilter_OnClick
+{
+  #keys: '[412672.0.1121729757]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      products := dhCheckedProduct.Data().Copy();
+      if( ddslGeneration.Text() <> "<All>" ){
+        products := selectset( products,Elements,element,element.Generation() <> ddslGeneration.Text());
+      }
+      if( ddslMQBMLB.Text() <> "<All>" ){
+        products := selectset( products,Elements,element,element.MQBMLB() <> ddslMQBMLB.Text());
+      }
+      if( ddslPower.Text() <> "<All>" ){
+        products := selectset( products,Elements,element,element.Power() <> ddslPower.Text());
+      }
+      dhFinelProduct.Data( &products );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslGeneration_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslGeneration_OnCreated.def
new file mode 100644
index 0000000..e5c27fc
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslGeneration_OnCreated.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: PanelFilter/ddslGeneration
+Response OnCreated () id:Response_PanelFilter_ddslGeneration_OnCreated
+{
+  #keys: '[412672.0.1121755350]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      strings := selectuniquevalues( MacroPlan,Product_MP,product,not product.IsSystem(),product.Generation() );
+      
+      res := strings.Concatenate( ";" );
+      
+      this.Strings( "<All>;" + res );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslMQBMLB_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslMQBMLB_OnCreated.def
new file mode 100644
index 0000000..209a4ce
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslMQBMLB_OnCreated.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: PanelFilter/ddslMQBMLB
+Response OnCreated () id:Response_PanelFilter_ddslMQBMLB_OnCreated
+{
+  #keys: '[412672.0.1121815924]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      strings := selectuniquevalues( MacroPlan,Product_MP,product,not product.IsSystem(),product.MQBMLB() );
+      
+      res := strings.Concatenate( ";" );
+      
+      this.Strings( "<All>;" + res );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslPower_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslPower_OnCreated.def
new file mode 100644
index 0000000..e419a94
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_ddslPower_OnCreated.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: PanelFilter/ddslPower
+Response OnCreated () id:Response_PanelFilter_ddslPower_OnCreated
+{
+  #keys: '[412672.0.1121816007]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      strings := selectuniquevalues( MacroPlan,Product_MP,product,not product.IsSystem(),product.Power() );
+      
+      res := strings.Concatenate( ";" );
+      
+      this.Strings( "<All>;" + res );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhEndDate_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhEndDate_OnCreated.def
new file mode 100644
index 0000000..23bc52c
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhEndDate_OnCreated.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelFilter/dhEndDate
+Response OnCreated () id:Response_PanelFilter_dhEndDate_OnCreated
+{
+  #keys: '[412672.0.1122841072]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      this.Data( Date::MaxDate() );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhStartDate_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhStartDate_OnCreated.def
new file mode 100644
index 0000000..d80fb7d
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dhStartDate_OnCreated.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelFilter/dhStartDate
+Response OnCreated () id:Response_PanelFilter_dhStartDate_OnCreated
+{
+  #keys: '[412672.0.1122841156]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      this.Data( Date::MinDate() );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsEndDate_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsEndDate_OnChanged.def
new file mode 100644
index 0000000..0f579a8
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsEndDate_OnChanged.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelFilter/dsEndDate
+Response OnChanged () id:Response_PanelFilter_dsEndDate_OnChanged
+{
+  #keys: '[412672.0.1122665296]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebDateTimeFieldBase_OnChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      dhEndDate.Data( this.Date() );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsStartDate_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsStartDate_OnChanged.def
new file mode 100644
index 0000000..eaa6855
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelFilter_dsStartDate_OnChanged.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelFilter/dsStartDate
+Response OnChanged () id:Response_PanelFilter_dsStartDate_OnChanged
+{
+  #keys: '[412672.0.1122665180]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebDateTimeFieldBase_OnChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      dhStartDate.Data( this.Date() );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_ButtonCompare_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_ButtonCompare_OnClick.def
index e372ac2..76c486e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_ButtonCompare_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_ButtonCompare_OnClick.def
@@ -10,7 +10,7 @@
     Body:
     [*
       
-      table := LocalCell_DemandComparison::Compared( RecycleBin,dhBaseVersionPath.Data(),dhCompareVersionPath.Data() );
+      table := LocalCell_DemandComparison::Compared( RecycleBin,dhBaseVersionPath.Data(),dhCompareVersionPath.Data(),lBaseVersionName.Text(),lCompareVersionName.Text() );
       dhComparisonData.Data( table );
     *]
     GroupServerCalls: false
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick\043723.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick\043723.def"
index 585ba3c..7d10d9a 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick\043723.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick\043723.def"
@@ -9,9 +9,9 @@
   {
     Body:
     [*
-      rows := selectset( dhComparisonData.Data(),LocalRow,row,true );
-      columns := selectset( dhComparisonData.Data( ),LocalColumn,column,true );
-      LocalCell_DemandComparison::AsyncExport( RecycleBin, rows, columns );
+      rows := selectset( dhComparisonData.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,product,product.ID() = row.Name() ) );
+      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 );
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListBaseVersionBudget_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListBaseVersionBudget_OnSelectionChanged.def
index 8cfbed8..69e9ffc 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListBaseVersionBudget_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListBaseVersionBudget_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListCompareVersionBudget_OnSelectionChange.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListCompareVersionBudget_OnSelectionChange.def
index 2a0e750..7c66484 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListCompareVersionBudget_OnSelectionChange.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionBudget_DropDownListCompareVersionBudget_OnSelectionChange.def
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListBaseVersionCurve_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListBaseVersionCurve_OnSelectionChanged.def
index a220cc2..7023788 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListBaseVersionCurve_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListBaseVersionCurve_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListCompareVersionCurve_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListCompareVersionCurve_OnSelectionChanged.def
index a427350..15c0069 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListCompareVersionCurve_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionCurve_DropDownListCompareVersionCurve_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DataExtractorOperationIDS_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DataExtractorOperationIDS_OnSelectionChanged.def
index 5500771..0f02dcb 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DataExtractorOperationIDS_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DataExtractorOperationIDS_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DropDownListBaseVersionIDS_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DropDownListBaseVersionIDS_OnSelectionChanged.def
index d5d74b3..e073306 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DropDownListBaseVersionIDS_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionIDS_DropDownListBaseVersionIDS_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListBaseVersionPPA_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListBaseVersionPPA_OnSelectionChanged.def
index 3962e2c..16667cd 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListBaseVersionPPA_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListBaseVersionPPA_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListCompareVersionPPA_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListCompareVersionPPA_OnSelectionChanged.def
index eb49f2b..edd14ce 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListCompareVersionPPA_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPPA_DropDownListCompareVersionPPA_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListBaseVersionPP_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListBaseVersionPP_OnSelectionChanged.def
index ffcbefc..5c17713 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListBaseVersionPP_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListBaseVersionPP_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListCompareVersionPP_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListCompareVersionPP_OnSelectionChanged.def
index d46fc20..8055aaf 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListCompareVersionPP_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPP_DropDownListCompareVersionPP_OnSelectionChanged.def
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListBaseVersionPR_OnSelectionChanged\04398.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListBaseVersionPR_OnSelectionChanged\04398.def"
index e477b8f..5a1fb6f 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListBaseVersionPR_OnSelectionChanged\04398.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListBaseVersionPR_OnSelectionChanged\04398.def"
@@ -14,7 +14,7 @@
     [*
       dhBaseVersionPR.Data( selection );
       this.Tooltip( selection.Name() );
-      efBaseVersion.Text( selection.Name() );
+      lBaseVersionName.Text( selection.Name() );
       dhBaseVersionPath.Data( selection.FilePath() );
     *]
   }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListCompareVersionPR_OnSelectionChanged\043599.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListCompareVersionPR_OnSelectionChanged\043599.def"
index 10a3e31..d5fe96a 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListCompareVersionPR_OnSelectionChanged\043599.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pSelectionPR_DropDownListCompareVersionPR_OnSelectionChanged\043599.def"
@@ -14,7 +14,7 @@
     [*
       this.Tooltip( selection.Name() );
       
-      efCompareVersion.Text( selection.Name() );
+      lCompareVersionName.Text( selection.Name() );
       dhCompareVersionPath.Data( selection.FilePath() );
     *]
   }

--
Gitblit v1.9.3