DEV 打印功能


Dev13.1 用的是DocumentViewer,上面的一排按鈕,是自動生成的,生成方法為:加了DocumentViewer后,控件右上角有個小三角,點一下,在彈出框中選擇"Create Standand ToolBar"就可以生成那一排按鈕。

form與Report綁定綁定:在Form1的Load事件中寫
XtraReport1 report1 = new XtraReport1();//這個是你建的一個報表
report1.DS = ds;//自己寫一個數據集就好了。
report1.Init();//自定義的綁定方法,在下面可以看到。
this.documentViewer1.PrintingSystem = report1.PrintingSystem;
report1.CreateDocument();

XtraReport1內的數據綁定:XtraReport1()中定義的綁定方法
手動綁定
public void Init()
{
    table1 = DS.Tables[0];
    table2 = DS.Tables[1];
    table3 = DS.Tables[2];

    DetailReport.DataSource = table1;
    xrTableCell1.DataBindings.Add("Text", table1, "姓名");
    xrTableCell2.DataBindings.Add("Text", table1, "出生年月");

    DetailReport1.DataSource = table2;
    xrTableCell3.DataBindings.Add("Text", table2, "姓名");
    xrTableCell4.DataBindings.Add("Text", table2, "家庭住址");

}

 

 源碼下載


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM