How to access data source using scripts
In this tutorial, we will learn how to access a report data source using scripts.
Let’s assume we have a report, its data source is set in the ReportManager and we need to access a separate record or field from one of the tables.
To demonstrate how to do that, let’s take a specific sample: we have the Customers data source. One of its tables is passed to the ReportManager component, and one of the fields of the table is “CompanyName”.
To access this field you can take advantage of the code sample below:
tbl = Engine.Objects["Customers"] as System.Data.DataTable;