Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Record Selection Formula Post Reply Post New Topic
Author Message
scathenc
Newbie
Newbie


Joined: 01 Jul 2009
Online Status: Offline
Posts: 4
Quote scathenc Replybullet Topic: Record Selection Formula
    Posted: 01 Jul 2009 at 10:39pm

Hi,

I have made a report whereby two tables are connected via their primary key. I wanted to show records where the primary key was equal to 6000030 for example.

I went into the record selection formula area and entered: {transaction.t_id} = '6000030'.

When I preview the report, it works perfectly, however if I load the exact same report through .Net (c#), it's as though the report ignores the selection formula and just goes ahead and shows all records.

I have tried entering the selection formula in the selection formula area, by linking it to a formula field, and also be entering it in code manually (dt.DataDefinition.RecordSelectionFormula = "{transactionlist.t_id} = '6000030'";. None of these are working and the report still shows all records.

I have made sure saving of data is turned off also. Does anyone have any ideas why this would be happening? (this is about my 50th report for this project, but the first where I have tried to use record selection. I use group selection in others and that works fine). Is this a bug in crystal??

C


IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Jul 2009 at 6:23am
I am assuming that you stopped the c# app and then restarted it?  if this is an embedded report, it will need to be recompiled, even if it is loaded dynamically, I might still be leary.  I am also assuming that you saved the report...silly things, but I have goofed on them before.
 
No, record selection formula (Report/Selection Formulas/Records) works in reports.  I haven't used it in a while (I have the app call a stored proc and then I set the report datasource to this dataset, so the report only sees valid records to begin with), but I have never used the group selection (I was told not to by the person who trained me...he had worked for Seagate as CR tech support), so I doubt that it is that.
 
It is probably something else....just don't know at this time.
 
I am also assuming that you are joining directly to the tables in the report, otherwise, you wouldn't need to filter.
 
IP IP Logged
scathenc
Newbie
Newbie


Joined: 01 Jul 2009
Online Status: Offline
Posts: 4
Quote scathenc Replybullet Posted: 05 Jul 2009 at 6:44pm

I rebuilt the app several times, and changed other things in the report to make sure it was running with the correct version. The only thing I can pin it down to, is that when c# loads the report, it is ignoring the recordselectionformula.

Any ideas?
IP IP Logged
scathenc
Newbie
Newbie


Joined: 01 Jul 2009
Online Status: Offline
Posts: 4
Quote scathenc Replybullet Posted: 05 Jul 2009 at 11:22pm

I have tried debugging my code, by logging all database calls that the report manager is trying to make when loading the report. It is just as I expected, the report is ignoring whatever I have put for the recordselectionformula.

Any ideas why loading the report through c# is ignoring the recordselectionformula, but previewing the report in crystal is not?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.