Symptom
Background: We create SQL conditions to support following features in Crystal Reports and we use SQLExpressions in some of the Reports.
- Upgrading from using the RDC to .NET
- To add security to the SQL Statement
- Many of our report templates are executed from our code via the SetDataSource approach. But the problem with the updated SDKs is that reports so created cannot utilize SQLExpressions in order to augment the report. When we add a SQLExpression as a report field and run.
Problem is we see multiple data rows, combination of both the SQLExpression connection and the Dataset connection.
Environment
Crystal Reports for Visual Studio
Reproducing the Issue
Cause
The problem is setting the Report location directly to the DB Server for the SQLExpression and then using a Dataset based on the same SQL from the reports merges the data from both connections.
Resolution
There are no specific SQL Expression Connection properties so the report will use it as a data source.
And because you cannot disconnect the SQL Expresssion connection the data will be merged.
The work around is use the RecordSelection Formula to add filtering and do not use a Dataset.
Keywords
SQLExpression, DataSets, cr for vs, multiple data sources , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem