How to access data source using scripts

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:

System.Data.DataTable tbl;


tbl = Engine.Objects["Customers"] as System.Data.DataTable;


Add Feedback