Query regarding SQL execution for Report

Stimulsoft Reports.NET discussion
Post Reply
rpooley
Posts: 15
Joined: Mon Jun 29, 2009 10:24 am
Location: London

Query regarding SQL execution for Report

Post by rpooley »

I have created an StiSqlDatabase source and added all the datasources with relations to a report.

The command text for each of the datasources is SELECT * FROM [TableName] - Replacing TableName with the real table name.

Say I have two tables A and B if I bind the report to A with no relations to B when I profile the database I will see that I get a SELECT * FROM [A] and SELECT * FROM

I was hoping that the query executed would only pull back data from the tables that the report needs not the entire contents of all the tables in the dictionary.
If table B has a million rows, running the report will bring down all one million B rows unless I remove the datasource even though the report does not use anything from B.

I was hoping that before the report runs it would generate a SQL Command that includes all the relationships and fields on the report so the query sent to the server would be optimized.

Would I be correct in assuming that if I want to solve this problem then I need to modify the SqlCommand for each DataSource to only include rows if the report needs it or before compile time remove the datasources I don't need.

Many thanks, and sorry to be a pain.

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

Query regarding SQL execution for Report

Post by Edward »

Hi Russel,

There is a workaround for such Master-Detail relationships when SQL queries are being used. Please see the video which explains how this has been realised in the Demo.exe sample application from the standard installation of Stimulsoft Reports.Net.

VIDEO



Thank you.
Post Reply