SQL statement with parameters in groups
Posted: Wed Mar 25, 2009 10:24 am
Hi,
we have a little question concerning SQL in Stimulsoft Reports.Net.
First of all we created a new datasource based on a SQL statement like the following one:
As you can see the statement contains two unnamed parameters, the whole statement contains more but we think that this fact is not relevant for the problem. We would prefer using named parameters but here in the forum we read that this is not possible with an OleDb connection - and it really does not work.
The specific problem now is that the SQL statement from above is only executed at the compiling time of the report. Our report has the following design.
So as you can see we need the SQL statement from above to be executed more than once with different parameters for each item in the group. How can we achieve this purpose? Because of the like statements it is impossible to execute the statement at the beginning without SoftwareID and use filters during group building. Is this possible and if yes how can we pass the SoftwareID from the current group to the SQL statement.
Thanks in advance. :feelgood:
we have a little question concerning SQL in Stimulsoft Reports.Net.
First of all we created a new datasource based on a SQL statement like the following one:
Code: Select all
SELECT DISTINCT [tSoftwareCache].[SoftwareCacheID], [tSoftwareCache].[SoftwareName], [tSoftwareCache].[SoftwarePublisher], [tSoftwareCache].[SoftwareVersion], [tSoftwareCache].[OSType]
FROM [tSoftwareCache], [tSoftwareKeywords], [tSoftwareProducts], [tSoftwareGroups]
WHERE [tSoftwareCache].[SoftwareName] LIKE [tSoftwareKeywords].[SoftwareName]
AND [tSoftwareCache].[SoftwareVersion] LIKE [tSoftwareKeywords].[SoftwareVersion]
AND [tSoftwareCache].[SoftwarePublisher] LIKE [tSoftwareKeywords].[SoftwarePublisher]
AND [tSoftwareProducts].[SoftwareID] =? AND [tSoftwareGroups].[GroupID] = [tSoftwareProducts].[GroupID]
AND [tSoftwareGroups].[AccountID] = [tSoftwareCache].[AccountID]
AND [tSoftwareKeywords].[KeywordType] = 0
AND [tSoftwareKeywords].[SoftwareID] =?
...
The specific problem now is that the SQL statement from above is only executed at the compiling time of the report. Our report has the following design.
Code: Select all
...
Group: [tSoftwarePorducts].[SoftwareID]
Virtual Table: SQL statement from above with current [tSoftwareProducts].[SoftwareID]
...
Group Footer
...
Thanks in advance. :feelgood: