Page 1 of 1

Bound DataRowView

Posted: Thu Apr 10, 2008 10:12 pm
by Arvin Boggs
Short version:
During Band.Rendering event in an application (not in the report), what is the bound DataRowView?

Long Version:
I've create a report with 2 bands. 1 band in master and the other is detail. They linked via a Relation.
At runtime, I used a DataSet to populate the data (via RegData).
All is well.
But now I decided to listen to the Band.Rendering event from my windows application (vb code).
For each execution of the Redering event, I want to do something based on the current data. I expect this current data to be a DataRow or DataRowView since I populated by report with a DataSet (with 2 DataTables) at runtime.
I tried myBand.DataSource.Position but it is useless because it resets to 0 on every loop of the master band.

Thanx in advance for your help.
I hope I explained well what I wanted to know.

Bound DataRowView

Posted: Thu Apr 10, 2008 10:46 pm
by Vital
Hello,

I'm not understand. If you want populate data from your dataset you can use property Position of datasource. This property reset to 0 for detail band on each masterband rendering. That correct too.

p.s. You can get data from datasource via following code:

object obj = report.Dictionary.DataSources["MyDataSource"]["MyField"];

This code return objects from current position in datasource.

Thank you.

Bound DataRowView

Posted: Thu Apr 10, 2008 10:59 pm
by Arvin Boggs
Hello Vital,

Thanx for the very prompt reply.
You solved my problem.

object obj = report.Dictionary.DataSources["MyDataSource"]["MyField"];

or

object obj = report.myBand["MyField"];

Bound DataRowView

Posted: Thu Apr 10, 2008 11:04 pm
by Vital
Hello,
arvinboggs wrote: object obj = report.myBand["MyField"];
This code is not correct.

Thank you.