Page 1 of 1

SQL queries

Posted: Wed Sep 23, 2009 4:35 pm
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

SQL queries

Posted: Wed Sep 23, 2009 6:14 pm
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.

SQL queries

Posted: Sat Oct 03, 2009 5:52 pm
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

SQL queries

Posted: Sun Oct 04, 2009 3:13 am
by Jan
Hello,

Try following code:

Code: Select all

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