How to bind a multiple rows from access table by query in runtime using XtraReport Winforms?

StackOverflow https://stackoverflow.com/questions/20761775

문제

How to bind a multiple rows to report in label or table ?? If my table is single row I can easily bind and it display in label and also display in table but my table consist of 2 or 3 rows it wont display. How to show multiple row in a report ? I need o filter it according to which item is selected ??

도움이 되었습니까?

해결책

Don't bind it directly. Use BeforePrint event for that label (not for the report!)

private void xrLabel4_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
  var id = this.GetCurrentColumnValue<int>("ID"); // get value of field ID for this row
  var lines = GetRows(id); // for demo only: returns string[]
  (sender as XRLabel).Lines = lines;
}

Don't forget to set property Multiline to true.

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