Interact with datasource

Stimulsoft Reports.NET discussion
Post Reply
isoft
Posts: 55
Joined: Fri Sep 08, 2006 9:33 am
Location: Croatia

Interact with datasource

Post by isoft »

Hi.

I was wondering is there a way to interact with the data in the datasource from the report code? For instance, if I import the System.Data.Sql and System.Data.SqlClient namespaces in the report code, then in an event of the report or component, I declare a datareader or sqlCommand and then write the code similar to this:

Code: Select all

Dim sql As String
Dim cmd As New SqlCommand(reportDataSource)
Dim dr As New SqlDataReader

sql = "SELECT * FROM reportDataSource WHERE ID_Field = variable"

cmd.CommandText = sql
dr = cmd.ExecuteReader

'Some code to check the values

dr.Close
It's just a thought and probably is far-stretched, but still I'm asking if it would be possible?

Thanks!
Ivan
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Interact with datasource

Post by Edward »

Unfortunately the DataReader is not supported by the StimulReport.Net as the DataSource for the Dictionary.

If you need to check some data from the reportDataSource from the Dictionary, then please provide us with information in which moment you need to do this, what is the aim of such a checking.

All the data which is transfered to the Report via RegData method is converted into the collection of DataTables. This collection can be accessible from the report and from other applications as well, but please inform at what moment do you need this information from ReportDataSources? How is the data registered in your report?

Thank you.
isoft
Posts: 55
Joined: Fri Sep 08, 2006 9:33 am
Location: Croatia

Interact with datasource

Post by isoft »

Hi.
Yes, I need to check the data from the reportDataSource from the Dictionary. What I would like to do is to get the count of records that have the same ID. Also, I would need to do the same thing, but the filter would not just be the the ID, but also some other values.

Thanks!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Interact with datasource

Post by Edward »

In that case the simplest way to process a DataSource from the Dictionary is using the "Data from Other DataSource" DataSource. This DataSource is able to filter, group and sort DataSources which is presented in the Designer.
For working with that component you should set Report.CacheAllData property in true.

You can move from row to row of that DataSource if needed via the following methods:

Next, Prior, First, Last

Thank you.
Post Reply