SQL queries

Stimulsoft Reports.NET discussion
Post Reply
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

SQL queries

Post by dikan »

After classic report I need to make one more page on what I have to put some data from database which are not directly in correlation with data from main report.
I have to make some SQL queries and put them on this new page but I do not know how can I do it from report definition.
I assume that I have to put some code in Event Tabs but I not sure where and how to code this.
Just for information, I am using C# for coding.

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

SQL queries

Post by Edward »

Hi,

This is not a problem with Stimulsoft Reports engine. You can add more than one connection to the Dictionary and then have as much new DataSources as it required by your report.

In case if you have to create a relation between DataSources from different connections, then choose Report object in the 'Properties' window and set CacheAllData property in true.

Thank you.
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

SQL queries

Post by dikan »

Ok. I added new DataSources and now I have two data soruces. On last page I made sum for a first data source and it returns me 223 than I made sum for a second data source and it's returns me 227 and now I want to subtract second total from first total and I can not do that. I tried with variables... I even try to make third total field like this {Count(Data2)-Count(Data1)} but it returns me only -223.

How can I accomplish this very trivial task. It is common for many reports with any kind of calculation so I am sure that I am missing something :brick: , but I do not now what it is.

Regards
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

SQL queries

Post by Jan »

Hello,

Try following code:

Code: Select all

{Totals.Count(datasource1) - Totals.Count(datasource2)}
Thank you.
Post Reply