天天看點

DEV XtraReport建立一個動态的報告

public static XtraReport CreateReport() {
    XtraReport report = new XtraReport() {
        Name = "SimpleStaticReport",
        DisplayName = "Simple Static Report",
        PaperKind = PaperKind.Letter,
        Margins = new DXMargins(100, 100, 100, 100)
    };

    DetailBand detailBand = new DetailBand() {
        HeightF = 25
    };
    report.Bands.Add(detailBand);

    XRLabel helloWordLabel = new XRLabel() {
        Text = "Hello, World!",
        Font = new DXFont("Tahoma", 20f, DXFontStyle.Bold),
        BoundsF = new RectangleF(0, 0, 250, 50),
    };
    detailBand.Controls.Add(helloWordLabel);

    return report;
}
           

下面的代碼示例建立一個新的報表,設定其名稱、顯示名稱、紙張種類和頁邊距,并添加 Detail Band Band,其中包含 XRLabel 控件。

DEV XtraReport建立一個動态的報告

繼續閱讀