Print Page | Close Window

Select Expert setting being ignored

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=303
Printed Date: 02 May 2024 at 3:41pm


Topic: Select Expert setting being ignored
Posted By: gee5767
Subject: Select Expert setting being ignored
Date Posted: 09 Mar 2007 at 1:26pm
Hello,
This is my first post here as I'm a new member.  I was wondering if anyone has seen this problem or knows of a solution. 
 
I am modifying an existing ASP.NET application that uses CR for the reporting functions.  I need to add a lookup table to several reports to pull descriptions for various fields like commodity type, buyer name, etc.  I have added the lookup table using the database expert and get the data I expect.  However, the lookup table hase a cytp field that tells me what to look for.  That is 'C' is commodity, 'B' is buyer.  So I thought I could qualify the query using the select expert for ctyp = 'B'  (I only want buyers on the report).  When I run the report I see all lookup table records regardless of the ctyp setting.  The SQL is here:
 
 SELECT "report_work_tbl"."whos", "report_work_tbl"."ebas", "report_work_tbl"."eact", "report_work_tbl"."buyr", "lookup_tbl"."ctyp", "lookup_tbl"."desc"
 FROM   "MCGSourcing"."dbo"."report_work_tbl" "report_work_tbl" INNER JOIN "MCGSourcing"."dbo"."lookup_tbl" "lookup_tbl" ON ("report_work_tbl"."whos"="lookup_tbl"."whos") AND ("report_work_tbl"."buyr"="lookup_tbl"."keyv")
 WHERE  "lookup_tbl"."ctyp"='B'
 ORDER BY "report_work_tbl"."whos", "report_work_tbl"."buyr"
 
Is there any know problem with the Select Expert in .NET?
 
Thanks
Greg in PA
We must all hang together, or assuredly we shall all hang separately.



Replies:
Posted By: BrianBischof
Date Posted: 09 Mar 2007 at 2:07pm
I don't know of a problem with the selection expert. In fact, the SQL that is being passed to the server uses your selection filter. Have you checked the SQL Server Profiler to view the actual SQL sees and how many rows it returns? I would copy it to the SQL Query tool and run it manually to see what the results are.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: gee5767
Date Posted: 09 Mar 2007 at 6:32pm
Brian,  Thanks for the quick reply. 
I have tried the SQL in the Query tool and it works as I expect.  I will check the SQL Server Profiler as you suggest.

Greg.


Posted By: gee5767
Date Posted: 10 Mar 2007 at 12:24pm
I found the problem. 
The recordSelectionFormula proerty of the ReportDocument was being overwritten in the VB codebehind of the ASP page that calls the report.  It ignored any criteria I entered in the CR designer.  I have added my code in the VB and all is now well.
 
Thanks,
Greg



Print Page | Close Window