문제

SO I want to create multiple XR objects, and add a page-break in between each object initialization. I've wrote a small example to demonstrate:

Inside of the XtraReportsClass I have this...

int k =0; 
public void addLabel()
{
    XRLabel l = new XRLabel();
    l.Text = "iteration:" + k;
    l.LocationF = new PointF(20, 200);
    k++;
    Detail.PageBreak = DevExpress.XtraReports.UI.PageBreak.AfterBand;
    Detail.Controls.Add(l);
}

So my logic is to create a label each time and call the label say from the main form like...

private void button1_Click(object sender, EventArgs e)
{
    xrReport r = new xrReport();
    r.addLabel();
    r.addLabel();
    r.addLabel();
    r.addLabel();
    r.ShowRibbonPreview();
}

And so I would expect to have a label on each page, at Location(20,200) with an output of "iteration:{value of k} " Unfortunately they are all punched up together at the same position and not moving to the next page...

I have already tried the,

private void Detail_BeforePrint(object sender, PrintEventArgs e)

event, Any suggestions?

도움이 되었습니까?

해결책

Dev Express has answered my question @ --> http://www.devexpress.com/Support/Center/Question/Details/Q404605

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top