void preview_DocumentPreviewMouseClick(DependencyObject d, DocumentPreviewMouseEventArgs e) { DocumentPreviewControl preview = e.OriginalSource as DocumentPreviewControl; ReportDocumentViewModel model = preview.Document as ReportDocumentViewModel; PropertyInfo pi = model.GetType().GetProperty("Report", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); XtraReport currentReport = pi.GetValue(model, null) as XtraReport; if (currentReport == null) { return; } if (String.Equals(currentReport.Tag.ToString(), "Master")) { if (e.ElementTag != null && !String.IsNullOrEmpty(e.ElementTag.ToString())) { string categoryName = (e.Brick as VisualBrick).Text; int categoryID = Convert.ToInt32(e.ElementTag); currentPageIndex = e.PageIndex + 1; XtraReport detailReport = GetDetailReport(categoryName, categoryID); preview.DocumentSource = detailReport; } } if (String.Equals(currentReport.Tag.ToString(), "Detail")) { preview.DocumentSource = null; preview.DocumentSource = masterReport; masterReport.CreateDocument(); preview.CurrentPageNumber = currentPageIndex; } }
// Change the mouse cursor when it hovers the label // that serves as a link to expand/collapse the detail data. public void OnPreviewMouseMove(DocumentPreviewMouseEventArgs args) { if (string.IsNullOrEmpty((string)args.ElementTag)) { return; } Mouse.SetCursor(Cursors.Hand); }
public void OnPreviewMouseMove(DocumentPreviewMouseEventArgs args) { var sortField = args.ElementTag as string; if (!string.IsNullOrEmpty(sortField)) { Mouse.SetCursor(Cursors.Hand); } }
public void OnPreviewMouseClick(DocumentPreviewMouseEventArgs args) { var sortField = args.ElementTag as string; if (!string.IsNullOrEmpty(sortField)) { Report.Sort(sortField); } }
public void OnPreviewMouseMove(DocumentPreviewMouseEventArgs args) { var orderId = args.ElementTag as int?; if (!orderId.HasValue) { return; } OrderId = orderId.Value; Mouse.SetCursor(Cursors.Hand); }
void OnPreviewMouseClick(DocumentPreviewMouseEventArgs args) { int categoryID; if (int.TryParse(string.Format("{0}", args.ElementTag), out categoryID)) { CategoryWrappers[categoryID].IsExpanded = !CategoryWrappers[categoryID].IsExpanded; tempPageNumber = CurrentPageNumber; Link.CreateDocumentFinished += link_CreateDocumentFinished; Link.CreateDocument(true); } }
public void OnPreviewMouseClick(DocumentPreviewMouseEventArgs args) { var orderId = args.ElementTag as int?; if (!orderId.HasValue) { return; } OrderId = orderId.Value; var invoiceReport = new InvoiceReport(); invoiceReport.Parameters["OrderId"].Value = OrderId; Report = invoiceReport; }
void Viewer_DocumentPreviewMouseClick(DependencyObject d, DocumentPreviewMouseEventArgs e) { if (e.Brick is LabelBrick) { VisualBrick brick = e.Brick as VisualBrick; if (e.Brick.Value != null && e.Brick.Value.ToString() != String.Empty) { Sort(e.Brick.Value.ToString(), Viewer.DocumentSource as XtraReport); } else { MessageBox.Show(String.Format("Cell value: {0}", brick.TextValue.ToString())); } } }
// Provide the drill-down functionality in the OnPreviewMouseClick event handler. public void OnPreviewMouseClick(DocumentPreviewMouseEventArgs args) { if (string.IsNullOrEmpty((string)args.ElementTag)) { return; } var categoryID = int.Parse(args.ElementTag.ToString()); var category = categories.FindByCategoryID(categoryID); if (expandedCategories.Contains(category)) { expandedCategories.Remove(category); } else { expandedCategories.Add(category); } Link.CreateDocument(true); }