public static ReportModel CreateModel (string reportName) { ReportStructure structure = CreateReportStructure(reportName); AvailableFieldsCollection abstractColumns = new AvailableFieldsCollection(); AbstractColumn a1 = new AbstractColumn("Field1",typeof(System.String)); structure.AvailableFieldsCollection.Add(a1); ICSharpCode.Reports.Core.BaseDataItem bri = new ICSharpCode.Reports.Core.BaseDataItem(); bri.Name ="Field1"; structure.ReportItemCollection.Add(bri); ReportModel m = structure.CreateAndFillReportModel(); ICSharpCode.Core.Properties customizer = new ICSharpCode.Core.Properties(); customizer.Set("Generator", structure); customizer.Set("ReportLayout",GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GeneratePushDataReport(m,customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return model; }
public ICSharpCode.Core.Properties ToProperties() { var p = new ICSharpCode.Core.Properties(); p.Set("Files", lastfile.ToArray()); p.Set("Projects", lastproject.ToArray()); return(p); }
public void SetMemento(ICSharpCode.Core.Properties memento) { Rect bounds = memento.Get("Bounds", new Rect(10, 10, 750, 550)); // bounds are validated after PresentationSource is initialized (see OnSourceInitialized) lastNonMinimizedWindowState = memento.Get("WindowState", System.Windows.WindowState.Maximized); SetBounds(bounds); }
public RecentOpen(ICSharpCode.Core.Properties p) { // don't check whether files exist because that might be slow (e.g. if file is on network // drive that's unavailable) // if one of these entries is a string, then it's from a previous SharpDevelop version - don't try loading it if (p.Contains("Files") && !(p.Get("Files") is string)) { lastfile.AddRange(p.Get("Files", new string[0])); } if (p.Contains("Projects") && !(p.Get("Files") is string)) { lastproject.AddRange(p.Get("Projects", new string[0])); } }
public static ReportModel CreateModel(string reportName, bool createGrouping) { ReportStructure structure = CreateReportStructure(reportName); AvailableFieldsCollection abstractColumns = new AvailableFieldsCollection(); AbstractColumn a1 = new AbstractColumn("Field1", typeof(System.String)); structure.AvailableFieldsCollection.Add(a1); ICSharpCode.Reports.Core.BaseDataItem bri = new ICSharpCode.Reports.Core.BaseDataItem(); bri.Name = "Field1"; structure.ReportItemCollection.Add(bri); if (createGrouping) { structure.Grouping = "group"; } ReportModel m = structure.CreateAndFillReportModel(); ICSharpCode.Core.Properties customizer = new ICSharpCode.Core.Properties(); customizer.Set("Generator", structure); customizer.Set("ReportLayout", GlobalEnums.ReportLayout.ListLayout); IReportGenerator generator = new GeneratePushDataReport(m, customizer); generator.GenerateReport(); ReportLoader rl = new ReportLoader(); object root = rl.Load(generator.XmlReport.DocumentElement); ReportModel model = root as ReportModel; if (model != null) { model.ReportSettings.FileName = GlobalValues.PlainFileName; FilePathConverter.AdjustReportName(model); } else { throw new InvalidReportModelException(); } return(model); }
public void SetMemento(ICSharpCode.Core.Properties memento) { throw new NotImplementedException(); }
public static RecentOpen FromXmlElement(ICSharpCode.Core.Properties properties) { return(new RecentOpen(properties)); }