Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Report ignores record selection filter

$
0
0

Hi everyone,

 

I recently upgraded Crystal Report from 2005 to 2012/2013 using the CRForVS 13.0.9.

But I ran into a problem when running my report inside my winforms application.

The report uses some fields from tables, no store procedures, no subreport or anything fancy, it is just linked to classic sql tables. It has a “select expert record” that specifies some filters like so :

 

Date({Flight.FlightDate}) =Date({?@DateReport}) and

{Flight.CustomerID} = {?@CustomerID} and

{Flight.Valid} and

{Flight.UnitID} = {?@UnitID} and

{Flight.Canceled} = False and

{category.DeliveryNote} = True and

({?@IncludeZeroQuantities} = true or {@QtyLoaded} <> 0.00)

 

When I run the report and the sql server profiler, I notice that the query sent to sql server to retrieve the data for my report is not filtered at all.

It just matches the “show sql query” of the report, which is actually just a bunch of inner join generated by the report.

Report’s parameters are set through code using the ParameterFields.CurrentValues.

 

In my 2005 version, I run the same report/code/parameters on the same machine but the sql query generated includes the filter which is much more efficient.

I have set a breakpoint in the 2013 version to make sure that it has the correct CurrentValues and number of parameters, and I checked that it has the RecordSelectionFormula too.

Do you see any reason that makes the 2012 or 2013 versions run an unfiltered query ?

 

This thing is killing, I’ve been fighting with it for 3 days already so any help would be much appreciated.

 

Thanks!


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>