Skip to Content
0
Former Member
May 05, 2009 at 02:12 PM

First time an SQL expression is placed on report a DB SELECT executes -CRXI

31 Views

The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).

Symptom:

We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.

Some Detective Work/More Info:

After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.

Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.

Steps to re-create:

1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)

2. Add a new "SQL Expression" to your report.

3. Drag and Drop your new "SQL Expression onto your report

4. You will see that Crystal has created an SQL query and executed it against your database in design environment.

The Problem:

I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).

Questions:

Can this functionality be disabled to prevent a production server from incurring the execution of these queries?

Anybody else notice this and have a "work around"?