private void LoadCustomReports() { customReportTreeView.Nodes.Clear(); MyParent.LoadUserDefinedReports(false);//RALLY DE 6239 m_userReportDictionary = MyParent.UserReportTypesDictionary; if (m_userReportDictionary == null || m_userReportDictionary.Count == 0) { m_customReportCounter = 0; return; } m_customReportCounter = m_userReportDictionary.Count; //we will limit 10 types only UserReportGroupTreeNode tempGroup; UserReportTypeTreeNode tempType; foreach (KeyValuePair <int, UserReportType> type in m_userReportDictionary) { tempType = new UserReportTypeTreeNode(type.Value, false); foreach (KeyValuePair <int, UserReportGroup> group in type.Value.UserReportGroups) { tempGroup = new UserReportGroupTreeNode(group.Value, false); for (int iReport = 0; iReport < group.Value.ReportsArray.Count; iReport++) { // determine report set to use ReportInfo info = (ReportInfo)group.Value.ReportsArray[iReport]; ReportTypes reportTypeID = (ReportTypes)info.TypeID; // START RALLY DE4505 - Do NOT show bingoCard reports if PWP is on. if ((info.ID == BingoCardSalesDetailReport || info.ID == BingoCardSummaryReport) && Configuration.m_playWithPaper && reportTypeID == ReportTypes.Sales) { continue; } //END RALLY DE4505 ReportSetTreeNode setTreeNode = null; foreach (ReportSetTreeNode setNode in tempGroup.Nodes) { if (setNode.ReportType == reportTypeID) { setTreeNode = setNode; break; } } if (setTreeNode == null) { setTreeNode = CreateReportSetTreeNode(reportTypeID); tempGroup.Nodes.Add(setTreeNode); } setTreeNode.Nodes.Add(new ReportTreeNode((ReportInfo)group.Value.ReportsArray[iReport], false)); } tempType.Nodes.Add(tempGroup); } customReportTreeView.Nodes.Add(tempType); } }
private void newGroupClick(object sender, EventArgs e) { frmInputBox newGroup = new frmInputBox(Resources.infoNewGroupPrompt, Resources.infoNewGroupTitle, Resources.infoNewGroupDefaultValue); newGroup.ShowDialog(); if (newGroup.DialogResult == DialogResult.OK) { UserReportGroupTreeNode addedNode = new UserReportGroupTreeNode(newGroup.InputValue, true); customReportTreeView.SelectedNode.Nodes.Add(addedNode); customReportTreeView.SelectedNode.Expand(); customReportTreeView.SelectedNode = addedNode; saveButton.Enabled = true; } }
private void customReportLabelEdit(object sender, NodeLabelEditEventArgs e) { if (e.Label != null) { if (e.Label.Length > 0) { if (IsValidAlphaNumeric(e.Label)) { // Stop editing without canceling the label change. e.Node.EndEdit(false); TreeNode tn = customReportTreeView.SelectedNode; tn.Text = e.Label; UserReportGroupTreeNode groupTreeNode = tn as UserReportGroupTreeNode; if (groupTreeNode != null) { if (groupTreeNode.ReportGroup != null) { groupTreeNode.ReportGroup.UserGroupName = tn.Text; saveButton.Enabled = true; } } UserReportTypeTreeNode typeTreeNode = tn as UserReportTypeTreeNode; if (typeTreeNode != null) { if (typeTreeNode.ReportType != null) { typeTreeNode.ReportType.UserReportTypeName = tn.Text; saveButton.Enabled = true; } } } else { /* Cancel the label edit action, inform the user, and * place the node in edit mode again. */ e.CancelEdit = true; MessageForm.Show(this, Resources.infoNameInvalid, Resources.report_center); e.Node.BeginEdit(); } } else { /* Cancel the label edit action, inform the user, and * place the node in edit mode again. */ e.CancelEdit = true; MessageForm.Show(this, Resources.infoNameNotNull, Resources.report_center); e.Node.BeginEdit(); } } }