/
Form1.cs
42 lines (40 loc) · 1.25 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
using DevExpress.XtraReports;
using DevExpress.XtraReports.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace dx_sample {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
XtraReport1 x = new XtraReport1();
x.DataSource = TestData.CreateRows();
ReportPrintTool pt = new ReportPrintTool(x);
pt.AutoShowParametersPanel = true;
pt.ShowPreviewDialog();
}
}
public class TestData {
public static List<TestData> CreateRows() {
List<TestData> l = new List<TestData>();
for (int i = 0; i < 50; i++) {
if (i == 1)
l.Add(new TestData { ID = i, Value = "Begin.\n\n\n\n\n\n\n\n\n\n\nEnd." });
else
l.Add(new TestData { ID = i, Value = "Begin. End." });
}
return l;
}
public int ID { get; set; }
public string Value { get; set; }
}
public class DataContainer : List<TestData> {
}
}