public override void InitModuleObjectRanges(InteropExcel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
 {
     string formula = string.Empty;
     formula = @"=INDIRECT(""_sqlstatements!$A$1:$J""&MAX(1;COUNTA(_sqlstatements!$A$1:$A$5000)))";
     rngp_SqlStatements = new ObjectRange();
     rngp_SqlStatements.InitRange(ActiveWorkbook, "_sqlstatements", "rngSqlstatements", formula, AddToWorkbook);
 }
Ejemplo n.º 2
0
        public override void InitModuleObjectRanges(InteropExcel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
        {
            string formula = string.Empty;
            rngp_Uploader = new ObjectRange();
            rngp_Uploader.InitRange(ActiveWorkbook, "_parameter", "TeamFile_rngUploader", "=_parameter!$A$1", AddToWorkbook);

            rngp_LastUpload = new ObjectRange();
            rngp_LastUpload.InitRange(ActiveWorkbook, "_parameter", "TeamFile_rngLastUpload", "=_parameter!$A$2", AddToWorkbook);

            rngp_LastDownload = new ObjectRange();
            rngp_LastDownload.InitRange(ActiveWorkbook, "_parameter", "TeamFile_rngLastDownload", "=_parameter!$A$3", AddToWorkbook);

            rngp_NameList = new ObjectRange();
            formula = @"=INDIRECT(""refNameList!$A$1:$F""&MAX(1;COUNTA(refNameList!$A$1:$A$5000)))";
            rngp_NameList.InitRange(ActiveWorkbook, "refNameList", "TeamFile_rngNameList", formula, AddToWorkbook);

            rngNames = new ObjectRange();
            formula = @"=INDIRECT(""refNameList!$A$1:$A""&MAX(1;COUNTA(refNameList!$A$1:$A$5000)))";
            rngNames.InitRange(ActiveWorkbook, "refNameList", "NameList", formula, AddToWorkbook);

            rngcl_CurrentTeamLS = new ObjectRange();
            formula = @"=INDIRECT(""Team!$G$13:$G190"")";
            rngcl_CurrentTeamLS.InitRange(ActiveWorkbook, "Team", "TeamFile_rngCurrentTeamLS", formula, AddToWorkbook);

            rngcl_CurrentTeamWOLS = new ObjectRange();
            formula = @"=INDIRECT(""Team!$H$13:$H190"")";
            rngcl_CurrentTeamWOLS.InitRange(ActiveWorkbook, "Team", "TeamFile_rngCurrentTeamWOLS", formula, AddToWorkbook);

            rngcl_AdditionalAllocationLS = new ObjectRange();
            formula = @"=INDIRECT(""Team!$I$13:$I190"")";
            rngcl_AdditionalAllocationLS.InitRange(ActiveWorkbook, "Team", "TeamFile_rngAdditionalAllocationLS", formula, AddToWorkbook);

            rngcl_AdditionalAllocationWOLS = new ObjectRange();
            formula = @"=INDIRECT(""Team!$J$13:$J190"")";
            rngcl_AdditionalAllocationWOLS.InitRange(ActiveWorkbook, "Team", "TeamFile_rngAdditionalAllocationWOLS", formula, AddToWorkbook);

            rngcl_BridgeCurrentTeam= new ObjectRange();
            formula = @"=INDIRECT(""Team!$E$13:$E190"")";
            rngcl_BridgeCurrentTeam.InitRange(ActiveWorkbook, "Team", "TeamFile_rngBridgeCurrentTeam", formula, AddToWorkbook);

            rngcl_PlanningArea = new ObjectRange();
            formula = @"=INDIRECT(""Team!$A$13:$T190"")";
            rngcl_PlanningArea.InitRange(ActiveWorkbook, "Team", "TeamFile_rngPlanningArea", formula, AddToWorkbook);

            rngcl_NameFixed = new ObjectRange();
            formula = @"=INDIRECT(""Team!$B$13:$B190"")";
            rngcl_NameFixed.InitRange(ActiveWorkbook, "Team", "TeamFile_rngNameFixed", formula, AddToWorkbook);

            rngcl_PlanningAreaFixed = new ObjectRange();
            formula = @"=INDIRECT(""Team!$A$13:$W190"")";
            rngcl_PlanningAreaFixed.InitRange(ActiveWorkbook, "Team", "TeamFile_rngPlanningAreaFixed", formula, AddToWorkbook);

            rngcl_Comment = new ObjectRange();
            formula = @"=INDIRECT(""Team!$T$13:$T190"")";
            rngcl_Comment.InitRange(ActiveWorkbook, "Team", "TeamFile_rngComment", formula, AddToWorkbook);

            rngcl_DateFrom = new ObjectRange();
            formula = @"=INDIRECT(""Team!$K$13:$K190"")";
            rngcl_DateFrom.InitRange(ActiveWorkbook, "Team", "TeamFile_rngDateFrom", formula, AddToWorkbook);

            rngcl_DateTo = new ObjectRange();
            formula = @"=INDIRECT(""Team!$L$13:$L190"")";
            rngcl_DateTo.InitRange(ActiveWorkbook, "Team", "TeamFile_rngDateTo", formula, AddToWorkbook);

            rngcl_Name = new ObjectRange();
            formula = @"=INDIRECT(""Team!$B$13:$B190"")";
            rngcl_Name.InitRange(ActiveWorkbook, "Team", "TeamFile_rngName", formula, AddToWorkbook);

            rngcl_Status = new ObjectRange();
            formula = @"=INDIRECT(""Team!$W$13:$W190"")";
            rngcl_Status.InitRange(ActiveWorkbook, "Team", "TeamFile_rngStatus", formula, AddToWorkbook);

            rngcl_MessageHeader = new ObjectRange();
            rngcl_MessageHeader.InitRange(ActiveWorkbook, "Team", "TeamFile_rngMessageHeader", "=Team!$A$11", AddToWorkbook);

            rngcl_Message = new ObjectRange();
            rngcl_Message.InitRange(ActiveWorkbook, "Team", "TeamFile_rngMessage", "=Team!$C$11", AddToWorkbook);

            rngp_ManagerList = new ObjectRange();
            formula = @"=INDIRECT(""_parameter!$F$1:$F""&MAX(1;COUNTA(_parameter!$F$1:$G$100)))";
            rngp_ManagerList.InitRange(ActiveWorkbook, "_parameter", "TeamFile_rngManagerList", formula, AddToWorkbook);

            rngp_TemplateUpdate = new ObjectRange();
            formula = @"=INDIRECT(""_parameter!$U$1:$U""&MAX(1;COUNTA(_parameter!$U$1:$U$100)))";
            rngp_TemplateUpdate.InitRange(ActiveWorkbook, "_parameter", "TeamFile_rngTemlateUpdate", formula, AddToWorkbook);

            rngp_Target = new ObjectRange();
            formula = @"=INDIRECT(""refTarget!$A$1:$B""&MAX(1;COUNTA(refTarget!$B$1:$B$500)))";
            rngp_Target.InitRange(ActiveWorkbook, "refTarget", "TeamFile_rngTarget", formula, AddToWorkbook);

            //TeamFileModuleTemplateUpdates updates = new TeamFileModuleTemplateUpdates();
            //TemplateUpdater.RunUpdates(updates, rngp_TemplateUpdate.GetRange());

            _SqlSatementModule.InitModuleObjectRanges(ActiveWorkbook, AddToWorkbook);
            var wsTeam = ActiveWorkbook.TryGetSheet("Team");
            if (wsTeam != null)
            {
                wsTeam.EnableOutlining = true;
                wsTeam.Protect("materia", AllowFiltering: true, UserInterfaceOnly: true);
            }
        }
        public override void InitModuleObjectRanges(InteropExcel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
        {
            _SqlSatementModule.InitModuleObjectRanges(ActiveWorkbook, AddToWorkbook);

            string formula = string.Empty;
            rngcl_SummaryArea = new ObjectRange();
            formula = @"=INDIRECT(""TeamApproval!$A$1:$V""&MAX(1;COUNTA(TeamApproval!$I$1:$I$5000)))";
            rngcl_SummaryArea.InitRange(ActiveWorkbook, "TeamApproval", "SummaryFile_rngSummaryArea", formula, AddToWorkbook);

            rngcl_SummaryUpload = new ObjectRange();
            formula = @"=INDIRECT(""TeamApproval!$E$2:$G""&MAX(2;COUNTA(TeamApproval!$I$1:$I$5000)))";
            rngcl_SummaryUpload.InitRange(ActiveWorkbook, "TeamApproval", "SummaryFile_rngSummaryUpload", formula, AddToWorkbook);

            rngp_Status = new ObjectRange();
            formula = @"=INDIRECT(""_parameter!$A$1:$A""&MAX(1;COUNTA(_parameter!$A$1:$A$5000)))";
            rngp_Status.InitRange(ActiveWorkbook, "_parameter", "SummaryFile_rngStatus", formula, AddToWorkbook);
        }
        //ha szükséges modulhoz range-ek létrehozása
        public override void InitModuleObjectRanges(Microsoft.Office.Interop.Excel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
        {
            string formula = string.Empty;
            rngp_CurrentTeam = new ObjectRange();
            formula = @"=INDIRECT(""CurrentTeam!$A$1:$I""&MAX(1;COUNTA(CurrentTeam!$B$1:$B$5000)))";
            rngp_CurrentTeam.InitRange(ActiveWorkbook, "CurrentTeam", "rngp_CurrentTeam", formula, AddToWorkbook);

            rngp_UploadArea = new ObjectRange();
            formula = @"=INDIRECT(""CurrentTeam!$A$2:$I""&MAX(2;COUNTA(CurrentTeam!$B$2:$B$5000)+1))";
            rngp_UploadArea.InitRange(ActiveWorkbook, "CurrentTeam", "rngp_UploadArea", formula, AddToWorkbook);

            rngp_Report = new ObjectRange();
            formula = @"=INDIRECT(""Report!$A$1:$G""&MAX(1;COUNTA(Report!$A$1:$A$5000)))";
            rngp_Report.InitRange(ActiveWorkbook, "Report", "rngp_Report", formula, AddToWorkbook);

            _SqlSatementModule.InitModuleObjectRanges(ActiveWorkbook, AddToWorkbook);
        }
Ejemplo n.º 5
0
 //ha szükséges modulhoz range-ek létrehozása
 public override void InitModuleObjectRanges(Microsoft.Office.Interop.Excel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
 {
     testRange = new ObjectRange();
     testRange.InitRange(ActiveWorkbook, "TestSheet", "TestRange", "=TestSheet!$A$1", AddToWorkbook);
 }
 public override void InitModuleObjectRanges(InteropExcel.Workbook ActiveWorkbook, bool AddToWorkbook = false)
 {
     exportRange = new ObjectRange();
     exportRange.InitRange(ActiveWorkbook, "ExportSheet", "exportRange", "=ExportSheet!$A$1", AddToWorkbook);
 }