public MainWindow() { InitializeComponent(); schedulerControl1.Start = new System.DateTime(2010, 7, 15, 0, 0, 0, 0); this.dataSet = new CarsDBDataSet(); // Bind Scheduler storage to appointment data this.schedulerControl1.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling; // Load data into the 'CarsDBDataSet.CarScheduling' table. this.adapter = new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter(); this.adapter.Fill(dataSet.CarScheduling); // Bind Scheduler storage to resource data this.schedulerControl1.Storage.ResourceStorage.DataSource = dataSet.Cars; // Load data into the 'CarsDBDataSet.Cars' table. CarsDBDataSetTableAdapters.CarsTableAdapter carsAdapter = new CarsDBDataSetTableAdapters.CarsTableAdapter(); carsAdapter.Fill(dataSet.Cars); this.schedulerControl1.Storage.AppointmentsInserted += new PersistentObjectsEventHandler(Storage_AppointmentsModified); this.schedulerControl1.Storage.AppointmentsChanged += new PersistentObjectsEventHandler(Storage_AppointmentsModified); this.schedulerControl1.Storage.AppointmentsDeleted += new PersistentObjectsEventHandler(Storage_AppointmentsModified); this.adapter.Adapter.RowUpdated += new System.Data.OleDb.OleDbRowUpdatedEventHandler(adapter_RowUpdated); }
public MainWindow() { InitializeComponent(); // Bind the scheduler to data. CarsDBDataSet dataSet = new CarsDBDataSet(); scheduler.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling; CarsDBDataSetTableAdapters.CarSchedulingTableAdapter tableAdapter = new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter(); tableAdapter.Fill(dataSet.CarScheduling); scheduler.Storage.ResourceStorage.DataSource = dataSet.Cars; CarsDBDataSetTableAdapters.CarsTableAdapter carsAdapter = new CarsDBDataSetTableAdapters.CarsTableAdapter(); carsAdapter.Fill(dataSet.Cars); // Set the scheduler start date. scheduler.Start = new System.DateTime(2010, 7, 15, 0, 0, 0, 0); // Specify the time inteval and start day of week used by the print adapter to create a report. printAdapter.TimeInterval = new TimeInterval(new DateTime(2010, 7, 15), new DateTime(2010, 7, 30)); printAdapter.FirstDayOfWeek = FirstDayOfWeek.Wednesday; // Specify required printing settings to be passed // to the SchedulerPrintHelper.ShowPrintPreview method that is called on a button click. printingSettings.ReportInstance = new XtraSchedulerReport(); printingSettings.SchedulerPrintAdapter = printAdapter; printingSettings.ReportTemplatePath = "WeeklyStyle.schrepx"; }
public MainWindow() { InitializeComponent(); this.dataSet = new CarsDBDataSet(); // Bind the scheduler storage to appointment data. storage.AppointmentStorage.DataSource = dataSet.CarScheduling; // Load data into the 'CarsDBDataSet.CarScheduling' table. this.tableAdapter = new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter(); this.tableAdapter.Fill(dataSet.CarScheduling); // Create a new report instance. XtraSchedulerReport report = new XtraSchedulerReport(); // Specify the scheduler storage for the print adapter. printAdapter.SchedulerStorage = storage; // Specify the time inteval and start day of week used by the print adapter to create a report. printAdapter.TimeInterval = new TimeInterval(new DateTime(2010, 7, 15), new DateTime(2010, 7, 30)); printAdapter.FirstDayOfWeek = FirstDayOfWeek.Tuesday; // Implement appointment filtering. printAdapter.ValidateAppointments += new AppointmentsValidationEventHandler(printAdapter_ValidateAppointments); // Specify the print adapter which provides data for the report. report.SchedulerAdapter = printAdapter.SchedulerAdapter; // Create a document from the report, so the report can be displayed or printed. report.CreateDocument(); // Create a preview model with the specified report. XtraReportPreviewModel previewModel = new XtraReportPreviewModel(report); // Specify the model for the DocumentPreview control. documentPreview.Model = previewModel; }