/
Form1.cs
37 lines (35 loc) · 1.31 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
using DevExpress.DashboardCommon;
using System;
namespace DashboardExport
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
CustomDashboardExporter customDashboardExporter;
CustomDashboardExporter CustomDashboardExporter {
get {
if(customDashboardExporter == null)
customDashboardExporter = new CustomDashboardExporter(dashboardViewer1);
return customDashboardExporter;
}
}
public Form1() {
InitializeComponent();
}
void Form1_Load(object sender, EventArgs e) {
Dashboard dashboard = new DevExpress.DashboardCommon.Dashboard();
dashboard.LoadFromXml(@"Data\CustomerSupport.xml");
dashboard.DataSources[0].Data =
new CustomerSupportData(
DataLoader.LoadCustomerSupport(),
DataLoader.LoadEmployees()
).CustomerSupport;
dashboardViewer1.Dashboard = dashboard;
}
void button1_Click_1(object sender, EventArgs e) {
CustomDashboardExporter.ShowPrintPreview(true);
}
private void button2_Click(object sender, EventArgs e) {
CustomDashboardExporter.ShowPrintPreview(false);
}
}
}