Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: filtering reports Post Reply Post New Topic
Page  of 2 Next >>
Author Message
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Topic: filtering reports
    Posted: 01 Sep 2008 at 9:12am
im recieving an error message when i try to filter a report on my website project : error message is as follows..
This field name is not known. Error in File C:\WINDOWS\TEMP\rptOrientacionesUsuario {81E783E3-FE97-4126-B09E-AA96E01DA869}.rpt: Error in formula . ' {SISAA.MAESTRO_USUARIOS_SIAL.NOMBRES} = ' ' ' This field name is not known.
 
my code is the following:
 
string selectFormula = " {MAESTRO_USUARIOS_SIAL.NOMBRES} = ' " + Class1.globaluser + " ' ";
            CrystalReportViewer1.SelectionFormula = selectFormula;
where MAESTRO_USUARIOS_SIAL.NOMBRES is the table and field im trying to filter by, and Class1.globaluser is a global string which contains the parameter I wish to filter by. any idea?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Sep 2008 at 11:01am
The problem is the "SISAA." in your formula. The formula you show in C# doesn't have the "SISSAA." in it. Somehow I think there is a disconnect between your C# code and Crsytal Reports. Somehow the "SISSAA." is sneaking into yoru report and you have to figure out how that is happening.
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>
IP IP Logged
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Posted: 01 Sep 2008 at 11:12am
no.. im sorry that was a none refreshed error messaeg.. the error message i do get is this...
 
This field name is not known. Error in File C:\WINDOWS\TEMP\rptOrientacionesUsuario {E7322BDD-77D8-4784-8EDC-1F7201B3E73E}.rpt: Error in formula . ' {MAESTRO_USUARIOS_SIAL.NOMBRES} = ' ' ' This field name is not known.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Sep 2008 at 11:43am
Ok. If that's the case, then the field isn't recognized by Crystal. The part before the "." is the table name and the part after the "." is the field name. The error message means that either the table name is wrong or the field name is wrong. You have to make sure that your datasource has both the table and field names available for printing.
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>
IP IP Logged
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Posted: 01 Sep 2008 at 11:54am
yeah that what i find ackward.. because where the field parameters is from that table and that field, i use a drop down box, to select the field i need and then im trying to filter it through the selectionformula.. :(
IP IP Logged
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Posted: 01 Sep 2008 at 12:01pm

maybe there is an error in my formula syntax? but i cant seem to find it...

IP IP Logged
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Posted: 01 Sep 2008 at 12:52pm
any ideas?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Sep 2008 at 1:14pm
The error states that the field name is not known. For some reason it isn't recognizing the name of the table or the field. Both that is all I can tell you from the error message given. Sorry.
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>
IP IP Logged
cardpogi
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Dominican Republic
Online Status: Offline
Posts: 20
Quote cardpogi Replybullet Posted: 01 Sep 2008 at 2:59pm
because look at the syntax on the error... is that right? {MAESTRO_USUARIOS_SIAL.NOMBRES} = ' ' ' is that = supposed to be there?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Sep 2008 at 3:47pm
The last ' is there because CR surrounds the error message with single quotes.
 
What about this, change the formula to hard-code a value you know is in the field. That way you test to see if that works at all.
string selectFormula = " {MAESTRO_USUARIOS_SIAL.NOMBRES} = ' 'Jones'";
Oh yeah - here is how I debug formulas. I FIRST create the formula with Crsytal Reports and make it the way I want it. SECOND, I run the program and go into debug mode. Then I print the formula in debug mode to see how CR stores it internally. I make sure that my formula matches EXACTLY with ZERO variation. Once I get that working, then I can tweak it by adding in variables from my program and make sure that it continues to work each step of the way.
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>
IP IP Logged
Page  of 2 Next >>
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.016 seconds.