protected virtual void OnFamilyGroupSheetReportWebPage_Activated(object sender, System.EventArgs e) { if (_currentView != null) { _currentView.SaveView(); // view may have changed the record so get what the view thinks // the current record is _record = _currentView.Record; } GedcomIndividualReport report = new GedcomIndividualReport(); report.Database = _database; report.Record = _record; report.AncestorGenerations = 1; // need to get the parents of the father/mother report.DecendantGenerations = - 2; // need 2 rather than 1 to pull in spouse for children report.BaseXsltName = "FamilyGroupReport"; GedcomIndividualRecord indi = _record as GedcomIndividualRecord; if (indi != null) { GedcomFamilyRecord fam = indi.GetFamily(); if (fam != null) { report.XrefID = fam.XRefID; } } string filename = report.CreateReport(); FileSelectorDialog fileSelector = new FileSelectorDialog(); fileSelector.Title = "Save Family Group Sheet Report As..."; fileSelector.AddFilter("text/html", "HTML Files"); fileSelector.AddFilter("application/pdf", "PDF Files"); fileSelector.AddFilter("image/svg+xml", "SVG Files"); fileSelector.SaveDialog = true; fileSelector.FileSelected += new EventHandler(ReportSave_FileSelected); fileSelector.UserData = filename; fileSelector.Run(); }
protected virtual void OnDecendantsReportWebPage_Activated(object sender, System.EventArgs e) { if (_currentView != null) { _currentView.SaveView(); // view may have changed the record so get what the view thinks // the current record is _record = _currentView.Record; } GedcomIndividualReport report = new GedcomIndividualReport(); report.Database = _database; report.Record = _record; report.DecendantGenerations = - int.MaxValue; report.BaseXsltName = "Descendants"; string filename = report.CreateReport(); FileSelectorDialog fileSelector = new FileSelectorDialog(); fileSelector.Title = "Save Decendants Report As..."; fileSelector.AddFilter("text/html", "HTML Files"); fileSelector.AddFilter("application/pdf", "PDF Files"); fileSelector.AddFilter("image/svg+xml", "SVG Files"); fileSelector.SaveDialog = true; fileSelector.FileSelected += new EventHandler(ReportSave_FileSelected); fileSelector.UserData = filename; fileSelector.Run(); }