This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
61 lines (51 loc) · 2.2 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#region #usings
using DevExpress.XtraReports.UI;
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Reporting;
#endregion #usings
using System;
using System.Windows.Forms;
namespace SchedulerReportingExample
{
public partial class Form1 : Form
{
#region #lastfetchedinterval
TimeInterval lastFetchedInterval = new TimeInterval();
#endregion #lastfetchedinterval
public Form1()
{
InitializeComponent();
schedulerStorage1.AppointmentsChanged += OnApptChangedInsertedDeleted;
schedulerStorage1.AppointmentsInserted += OnApptChangedInsertedDeleted;
schedulerStorage1.AppointmentsDeleted += OnApptChangedInsertedDeleted;
schedulerControl1.GroupType = SchedulerGroupType.Resource;
schedulerControl1.Start = DateTime.Today;
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'scheduleTestDataSet.Resources' table. You can move, or remove it, as needed.
this.resourcesTableAdapter.Fill(this.scheduleTestDataSet.Resources);
// TODO: This line of code loads data into the 'scheduleTestDataSet.Appointments' table. You can move, or remove it, as needed.
this.appointmentsTableAdapter.Fill(this.scheduleTestDataSet.Appointments);
}
private void OnApptChangedInsertedDeleted(object sender, PersistentObjectsEventArgs e)
{
this.appointmentsTableAdapter.Update(scheduleTestDataSet);
this.scheduleTestDataSet.AcceptChanges();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
#region #showreport
XtraSchedulerReport1 xr = new XtraSchedulerReport1();
SchedulerControlPrintAdapter scPrintAdapter =
new SchedulerControlPrintAdapter(this.schedulerControl1);
xr.SchedulerAdapter = scPrintAdapter;
xr.CreateDocument(true);
using (ReportPrintTool printTool = new ReportPrintTool(xr))
{
printTool.ShowRibbonPreviewDialog();
}
#endregion #showreport
}
}
}