private Workbook OpenManualFile() { string initialDirectory = String.Format(@"{0}\{1}\{2}", Path, RelativePath, "Original_Files"); Common.WriteToDebugWindow(String.Format(@"OpenFile: {0}", initialDirectory)); Workbook wb = null; wb = Globals.ThisAddIn.Application.Workbooks.Open( Filename: ExcelHlp.GetOpenFileName(initialDirectory), UpdateLinks: false, ReadOnly: true); if (wb != null) { pnlTask_OpenFile.BackColor = Color.Green; pnlTask_ConfirmAsOfDate.BackColor = Color.White;; } else { pnlTask_OpenFile.BackColor = Color.Red; } return(wb); }
XlHlp.XlLocation AddSection_ChildNodes( XlHlp.XlLocation insertAt, string NodeType, ReadOnlyCollection <CatalogNode> childNodes) { //XlHlp.DisplayInWatchWindow(insertAt); //// List the team project collections XlHlp.AddContentToCell(insertAt.InsertRow(1), string.Format("{0}({1})", NodeType, childNodes.Count)); //currentRow = startingRow; //int innerRowsAdded = 0; //int col = 1; //foreach (CatalogNode child in childNodes) //{ // // Need to fix this so expands down the page // innerRowsAdded = AddSection_CatalogNode(ws, rngOutput, child); // insertAt = innerRowsAdded; // currentRow += innerRowsAdded; //} //XlLocation.Rows++; return(insertAt); }
/// <summary> /// Ensure the worksheet only has rows with actual data. Remove cells with blanks, total rows, etc. /// </summary> /// <param name="ws"></param> private void CleanOutExtraDataOnWorksheet(Worksheet ws) { Common.WriteToDebugWindow(String.Format("CleanOutExtraDataOnWorksheet()")); switch (FileType) { case "FundServiceFees": case "FundAdvisoryFees": // TODO: May need different end columns. For now presume the 6 from fees spreadsheets. // Take the switch(FileType) code from GetOutputFileName(); Range dataRange = ws.Range[ws.Cells[1, 1], ws.Cells[RecordCount, 6]]; dataRange.Copy(); Globals.ThisAddIn.Application.ActiveWorkbook.Sheets.Add(); ((Worksheet)Globals.ThisAddIn.Application.ActiveSheet).Paste(); // Quietly delete the source worksheet to avoid confusion. ExcelHlp.DeleteSheet(ws); break; case "CashManagementFees": break; case "VITsFees": ProcessVITsFees(ws); break; default: MessageBox.Show("Processing of Manual FileType: {0} not currently supported", FileType); break; } }
void AddIDColumn() { Int32 startRow; Int32 endRow; try { Worksheet ws = Globals.ThisAddIn.Application.ActiveSheet; Range rng = Globals.ThisAddIn.Application.Selection; Range currentCell = Globals.ThisAddIn.Application.ActiveCell; startRow = currentCell.Row; //endRow = startRow + rng.Rows.Count - 1; endRow = XlHlp.FindLast_PopulatedRow_InColumn(currentCell); XlHlp.AddColumnToSheet(ws, 1, 10, false, "", XlDirection.xlToRight, XlInsertFormatOrigin.xlFormatFromLeftOrAbove, startRow - 1, null); Range idRng = currentCell.Offset[0, -1]; for (int i = 1; i <= endRow - startRow + 1; i++) { idRng.Cells[i, 1].Value = i; //ws.Cells[i + startRow - 1, 1].Value = i; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
internal static void DisplayLoopUpdates(long startTicks, Options_AZDO_TFS options, int totalItems, int itemCount) { if (itemCount % options.LoopUpdateInterval == 0) { XlHlp.DisplayInWatchWindow($"Completed {itemCount} out of {totalItems}", startTicks); } }
internal static void Add_TP_Shelvesets( XlHlp.XlLocation insertAt, Options_AZDO_TFS options, Shelveset[] shelvesets) { Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY); try { foreach (Shelveset item in shelvesets) { insertAt.ClearOffsets(); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.OwnerDisplayName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.OwnerName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.Name); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.CreationDate.ToString()); //ExcelHlp.AddContentToCell(insertAt.AddOffsetColumn(), item.DisplayName); //ExcelHlp.AddContentToCell(insertAt.AddOffsetColumn(), item.QualifiedName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.CheckinNote.ToString()); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.Comment); insertAt.IncrementRows(); } } catch (Exception ex) { string msg = string.Format("{0} - {1}", "TP", ex.ToString()); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), msg); } Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks); }
internal static void Add_TP_Workspaces( XlHlp.XlLocation insertAt, Options_AZDO_TFS options, Workspace[] workSpaces) { Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY); foreach (Workspace workspace in workSpaces) { insertAt.ClearOffsets(); // Keep in same order with headers, supra. XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Computer); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Name); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.OwnerDisplayName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.OwnerName); //ExcelHlp.AddContentToCell(rngOutput.Offset[currentRow, col++], workspace.DisambiguatedDisplayName); //ExcelHlp.AddContentToCell(rngOutput.Offset[currentRow, col++], workspace.DisplayName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.LastAccessDate.ToString()); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Comment); //ExcelHlp.AddContentToCell(rngOutput.Offset[XlLocation.Rows, col++], workspace.QualifiedName); insertAt.IncrementRows(); } Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks); }
public static void ProcessCreateWorkSheet(ProcessCreateWorksheetCommand command, Options_AZDO_TFS options) { long startTicks = Log.APPLICATION($"Enter ({command.Method.Name})", Common.PROJECT_NAME); XlHlp.DisplayInWatchWindow(string.Format("{0} {1}", MethodBase.GetCurrentMethod().Name, command.Method.Name)); try { SpeedUpStart(); Common.PriorStatusBar = Globals.ThisAddIn.Application.StatusBar.ToString(); command(options); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { SpeedUpEnd(); Globals.ThisAddIn.Application.StatusBar = Common.PriorStatusBar; } Log.APPLICATION($"Exit ({command.Method.Name})", Common.PROJECT_NAME, startTicks); }
internal static void Add_TP_Developers( XlHlp.XlLocation insertAt, Options_AZDO_TFS options, string teamProjectName, SortedDictionary <string, int> developers, SortedDictionary <string, DateTime> developersLatestDate, SortedDictionary <string, DateTime> developersEarliestDate) { Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY); foreach (string developer in developers.Keys) { insertAt.ClearOffsets(); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), teamProjectName); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developer); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developers[developer].ToString()); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developersEarliestDate[developer].ToString()); XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developersLatestDate[developer].ToString()); insertAt.IncrementRows(); } Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks); }
public static void SpeedUpEnd() { // NOTE(crhodes) // These keep track of prior state, but not having screen updates make no sense XlHlp.CalculationsOn(force: true); XlHlp.ScreenUpdatesOn(force: true); }
public static void SpeedUpStart() { // NOTE(crhodes) // These keep track of prior state XlHlp.ScreenUpdatesOff(); XlHlp.CalculationsOff(); }
internal static XlHlp.XlLocation Add_Info( XlHlp.XlLocation insertAt, TeamProject teamProject) { long startTicks = XlHlp.DisplayInWatchWindow(insertAt); insertAt.MarkStart(); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "TP Name", teamProject.Name); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "AbsoluteUri", teamProject.ArtifactUri.AbsoluteUri); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ServerItem", teamProject.ServerItem); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "VCS ServerGuid", teamProject.VersionControlServer.ServerGuid.ToString()); // TODO(crhodes) // What else can we get here? // Capabilities // Template? // Creation Date? insertAt.MarkEnd(); if (!insertAt.OrientVertical) { // Skip past the info just added. insertAt.SetLocation(insertAt.RowStart, insertAt.MarkEndColumn + 1); } XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End"); return(insertAt); }
private void SaveControlFile() { Common.WriteToDebugWindow(String.Format("SaveControlFile:{0},{1},{2},{3:F2}", CycleDate.ToShortDateString(), CurrentDate.ToShortDateString(), RecordCount, TotalAmount)); string fileName = null; string initialDirectory = OutputPath; if (null != (fileName = GetControlFileName())) { string outputFile = ExcelHlp.GetSaveFileName(initialDirectory, fileName); FileInfo fileInfo = new FileInfo(outputFile); OutputPath = fileInfo.DirectoryName; using (StreamWriter writer = new StreamWriter(outputFile)) { // TODO:(crhodes) Remove TotalAmount for CMF output writer.Write(String.Format("{0},{1},{2},{3:F2}", CycleDate.ToShortDateString(), CurrentDate.ToShortDateString(), RecordCount, TotalAmount)); writer.Close(); } pnlTask_SaveControlFile.BackColor = Color.Green; } else { pnlTask_SaveControlFile.BackColor = Color.Red; } }
//private static IEnumerable<List> Get_Lists(ClientContext ctx, Web web) //{ // var alllists = web.Lists; // IEnumerable<List> lists = ctx.LoadQuery(alllists.Where // (list => list.BaseType == BaseType.GenericList) // ); // ctx.ExecuteQuery(); // return lists; //} private XlHlp.XlLocation AddSection_Lists(XlHlp.XlLocation insertAt, ClientContext ctx, Web web) { XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt); if (insertAt.OrientVertical) { XlHlp.AddTitledInfo(insertAt.AddRow(), "Lists", web.Title); } else { XlHlp.AddTitledInfo(insertAt.AddRow(), "Lists", web.Title, orientation: XlOrientation.xlUpward); insertAt.IncrementColumns(); } IEnumerable <List> lists = VNCSP.Helper.GetLists(ctx, web); insertAt.MarkStart(XlHlp.MarkType.GroupTable); insertAt = DisplayListOf_Lists(insertAt, lists, false, "OneLevel"); insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblLists_{0}", web.Title)); insertAt.Group(insertAt.OrientVertical, hide: true); insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical); XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End"); return(insertAt); }
private void Get_TPC_Info() { long startTicks = XlHlp.DisplayInWatchWindow("Begin"); Options_AZDO_TFS options = GetOptions(); try { RequestHandlers.SpeedUpStart(); //// Get the Team Project Collections //ReadOnlyCollection<CatalogNode> projectCollectionNodes = VNCTFS.Helper.Get_TeamProjectCollectionNodes(AzureDevOpsExplorer.Presentation.Views.Server.ConfigurationServer); var tpcCatalogNode = AzureDevOpsExplorer.Presentation.Views.Server.TfsTeamProjectCollection.CatalogNode; CreateWS_TPC_Info(tpcCatalogNode, AzureDevOpsExplorer.Presentation.Views.Server.TfsTeamProjectCollection, false, options); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { RequestHandlers.SpeedUpEnd(); } XlHlp.DisplayInWatchWindow("End", startTicks); }
private void btnCodeChurn_Click(object sender, RoutedEventArgs e) { long startTicks = XlHlp.DisplayInWatchWindow("Start"); Options_AZDO_TFS options = GetOptions(); try { RequestHandlers.SpeedUpStart(); //TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://WhateverServerUrl"); //IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer)); //VersionControlServer VsServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); //IBuildDetail build = buildServer.GetAllBuildDetails(new Uri("http://WhateverBuildUrl")); //List<IChangesetsummary> associatedChangesets = InformationNodeConverters.GetAssociatedChangesets(build); //foreach (IChangesetsummary changeSetData in associatedChangesets) //{ // Changeset changeSet = VsServer.GetChangeset(changeSetData.ChangesetId); // foreach (Change change in changeSet.Changes) // { // bool a = change.Item.IsContentDestroyed; // long b = change.Item.ContentLength; // } //} } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { RequestHandlers.SpeedUpEnd(); } }
private void btnUnmergedChanges_Click(object sender, RoutedEventArgs e) { long startTicks = XlHlp.DisplayInWatchWindow("Begin"); try { RequestHandlers.SpeedUpStart(); MergeCandidate[] mergeCandidates = AzureDevOpsExplorer.Presentation.Views.Server.VersionControlServer.GetMergeCandidates("$/Development", "$/Release", RecursionType.Full); foreach (var mergeCandidate in mergeCandidates) { if (mergeCandidate.Changeset.Owner == @"DOMAIN\ChuckNorris") { //This is an unmerged changeset commited by Chuck } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { RequestHandlers.SpeedUpEnd(); } XlHlp.DisplayInWatchWindow("End", startTicks); }
private void PopulateTeamProjects() { long startTicks = XlHlp.DisplayInWatchWindow("Begin"); try { var projectList = (from Project prj in AzureDevOpsExplorer.Presentation.Views.Server.WorkItemStore.Projects select prj.Name).ToList(); //ObservableCollection<string> itemCol = new; //itemCol.BeginUpdate(); //itemCol.Clear(); var priorStatusBar = Globals.ThisAddIn.Application.StatusBar; foreach (var item in projectList) { ((OptionsViewModel)azdoOptions.ViewModel).TeamProjects.Add(item); Globals.ThisAddIn.Application.StatusBar = $"{item}"; } Globals.ThisAddIn.Application.StatusBar = priorStatusBar; //itemCol.EndUpdate(); //((AZDOOptionsViewModel)AZDOOptions.ViewModel).TeamProjects = itemCol; } catch (Exception ex) { MessageBox.Show(ex.ToString()); // Should we throw? } XlHlp.DisplayInWatchWindow("End", startTicks); }
void FindLongestTimeForward() { XlHlp.DisplayInWatchWindow(string.Format("{0}", System.Reflection.MethodInfo.GetCurrentMethod().Name)); Microsoft.Office.Interop.Excel.Application app = Globals.ThisAddIn.Application; Worksheet ws = app.ActiveSheet; Int32 startingRow = app.ActiveCell.Row; Int32 currentColumn = app.ActiveCell.Column; Int32 durationColumn = currentColumn + 1; Range startingCell = Globals.ThisAddIn.Application.Cells[startingRow, durationColumn]; string totalTime = string.Empty; string subTime = string.Empty; // TODO(crhodes) // go the the exit time totalTime = GetMatchingExitDuration(startingCell); // TODO(crhodes) // Search forwards up to the matching exit for the longest time and put the cursor there UpdateTimeControls(totalTime, subTime); }
internal static XlHlp.XlLocation AddSection_ConfigurationServer_Info( XlHlp.XlLocation insertAt, TfsConfigurationServer configurationServer) { insertAt.MarkStart(XlHlp.MarkType.None); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Name:", configurationServer.Name); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Culture:", configurationServer.Culture.DisplayName); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "InstanceId:", configurationServer.InstanceId.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ServerCapabilities:", configurationServer.ServerCapabilities.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "SessionId:", configurationServer.SessionId.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "TimeZone:", configurationServer.TimeZone.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "UICulture", configurationServer.UICulture.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Uri", configurationServer.Uri.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "AuthorizedIdentity:", configurationServer.AuthorizedIdentity.DisplayName); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "CatalogNode:", configurationServer.CatalogNode.FullPath); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "HasAuthenticated:", configurationServer.HasAuthenticated.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "IsHostedServer:", configurationServer.IsHostedServer.ToString()); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ClientCacheDirectoryForInstance:", configurationServer.ClientCacheDirectoryForInstance); XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ClientCacheDirectoryForUser:", configurationServer.ClientCacheDirectoryForUser); insertAt.MarkEnd(XlHlp.MarkType.None); if (!insertAt.OrientVertical) { // Skip past the info just added. insertAt.SetLocation(insertAt.RowStart, insertAt.MarkEndColumn + 1); } return(insertAt); }
private void teNamedRange_LostFocus(object sender, RoutedEventArgs e) { // TODO(crhodes) // Maybe do the find here could also have a button string namedRange = teNamedRange.Text; string sheetName = XlHlp.SafeSheetName(namedRange); Int32 startRow = 0; Int32 endRow = 0; if (FindNamedRangeRows(namedRange, "Start:", "End:", out startRow, out endRow)) { teStartRowNamedRange.Text = startRow.ToString(); teEndRowNamedRange.Text = endRow.ToString(); teSheetNameNamedRange.Text = sheetName; } else { teStartRowNamedRange.Text = "??"; teEndRowNamedRange.Text = "??"; teSheetNameNamedRange.Text = "<Range Not Found>"; } }
void ExtractNamedRegion() { XlHlp.DisplayInWatchWindow(string.Format("{0}", System.Reflection.MethodInfo.GetCurrentMethod().Name)); Microsoft.Office.Interop.Excel.Application app = Globals.ThisAddIn.Application; Worksheet sourceWs = app.ActiveSheet; Int32 startRow = 0; Int32 endRow = 0; string sheetName = ""; string namedRange = teNamedRange.Text; FindNamedRangeRows(namedRange, "Start:", "End:", out startRow, out endRow); if (ceUseRowNumbers.IsChecked == true) { sheetName = string.Format("{0}_{1}", startRow, endRow); } else if ("" == (sheetName = teSheetNameNamedRange.Text)) { System.Windows.Forms.MessageBox.Show("SheetName not valid"); return; } sheetName = CopyRowsToNewWorkSheet(sourceWs, startRow, endRow, sheetName); teStartRowNamedRange.Clear(); teEndRowNamedRange.Clear(); teSheetNameNamedRange.Clear(); }
private void btnDo_Something_Click(object sender, RoutedEventArgs e) { if (!ValidUISelections()) { return; } bool orientVertical = GetDisplayOrientation(); // Sometimes we know better //orientVertical = true; // This sheet works better vertically. try { XlHlp.ScreenUpdatesOff(); // Put Actions Here. If Creating a Worksheet it would look like one of these. // TODO(crhodes): Maybe can do this with a delegate passed into a routine that does all this boilerplate stuff. //CreateWorksheet_All_TP_Developers(orientVertical); //CreateWorksheet_All_TP_AreaCheck(cbeAreas.Text, orientVertical); //CreateWorksheet_VCS_Branches(wucTFSProvider_Picker.Uri, teTeamProjectCollection.Text, orientVertical); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { XlHlp.ScreenUpdatesOn(true); } }
private void cbeTeamProjectCollections_SelectedValueChanged(object sender, EventArgs e) { XlHlp.DisplayInWatchWindow(string.Format("{0}", System.Reflection.MethodInfo.GetCurrentMethod().Name)); try { //_tfsTeamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(cbeTeamProjectCollections.SelectedText)); //if (_tfsTeamProjectCollection == null) //{ // MessageBox.Show("Cannot GetTeamProjectCollection"); // return; //} //// Each time we change TeamProjectCollection, go get all the services we will use //// and put in _<member> variables. //Populate_TPC_Services(_tfsTeamProjectCollection); //PopulateTeamProjects(_tfsTeamProjectCollection); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private VNC.AddinHelper.Excel.XlLocation DisplayListOf_Lists(VNC.AddinHelper.Excel.XlLocation insertAt, IEnumerable <List> lists, bool displayDataOnly, string tableSuffix) { XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt); Worksheet ws = insertAt.workSheet; if (!displayDataOnly) { insertAt.MarkStart(XlHlp.MarkType.GroupTable); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "Title"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 15, "Id"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "SchemaXml"); insertAt.IncrementRows(); } foreach (var list in lists) { insertAt.ClearOffsets(); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.Title); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.Id.ToString()); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.SchemaXml); insertAt.IncrementRows(); } XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End"); return(insertAt); }
private XlHlp.XlLocation DisplayListOf_ContentTypes(XlHlp.XlLocation insertAt, ContentTypeCollection contentTypes, bool displayDataOnly, string tableSuffix) { XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt); Worksheet ws = insertAt.workSheet; if (!displayDataOnly) { insertAt.MarkStart(XlHlp.MarkType.GroupTable); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "Name"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Group"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 15, "Id"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "SchemaXml"); insertAt.IncrementRows(); } foreach (var cType in contentTypes) { insertAt.ClearOffsets(); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Name); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Group); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Id.ToString()); XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.SchemaXml); insertAt.IncrementRows(); } XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End"); return(insertAt); }
internal static void Add_BuildServiceHosts(XlHlp.XlLocation insertAt) { XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Status"); XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "StatusChangedOn"); insertAt.IncrementRows(); }
internal static void Add_BuildAgents(XlHlp.XlLocation insertAt) { XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name"); //XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Description"); //XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "QueueStatus"); insertAt.IncrementRows(); }
void _ExcelApplication_WorkbookBeforePrint(Microsoft.Office.Interop.Excel.Workbook Wb, ref bool Cancel) { DisplayInWatchWindow(WorkbookBeforePrint++, System.Reflection.MethodInfo.GetCurrentMethod().Name); if (ExcelHlp.HasCustomFooter()) { Actions.Excel_PageFormatting.AddFooter(); } }
private XlHlp.XlLocation AddSection_SiteGroups(XlHlp.XlLocation insertAt, ClientContext ctx, Web web) { XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt); //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "Groups", "SiteName"); //Range rng = ws.Cells[startingRow, 1]; //int rowsAdded = 0; //var siteGroups = web.SiteGroups; ////IEnumerable<List> groups = ctx.LoadQuery(siteGroups.Where(true)); //ctx.Load(siteGroups); //ctx.ExecuteQuery(); //foreach (var group in siteGroups) //{ // int col = 0; // //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.LoginName); // Seems same as Title // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Title); // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Id.ToString()); // //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Owner.LoginName); // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.PrincipalType.ToString()); // rowsAdded++; // UserCollection users = ctx.Web.SiteGroups.GetById(group.Id).Users; // ctx.Load(users); // ctx.ExecuteQuery(); // foreach (var user in users) // { // col = 4; // //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.LoginName); // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Title); // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Id.ToString()); // //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.UserId.ToString()); // XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.PrincipalType.ToString()); // rowsAdded++; // } // rowsAdded++; //} //insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblSiteGroups_{0}", web.Title)); //insertAt.Group(insertAt.OrientVertical, hide: true); //insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical); //XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End"); return(insertAt); }