Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Problem with IF statement Post Reply Post New Topic
Author Message
as.yanev
Newbie
Newbie


Joined: 05 Jun 2011
Location: Bulgaria
Online Status: Offline
Posts: 4
Quote as.yanev Replybullet Topic: Problem with IF statement
    Posted: 05 Jun 2011 at 11:40pm
I use Visual Studio 2005 with Crystal Report and i create an application, that read DB via ODBC. So i have a big problem, that i can't solve. The Report has couple of Formula Fields with code like this:

if {table.GlobalTypeCode} = 0 then
   {table.Name}


Everything works fine, but the problem is that the fields with GlobalTypeCode = 0 are 10 and all fields is about 3000, so i have report with 165 blank pages Ouch. Is there a way to remove this blank records from the report with some specific else of something???
Thanks in Advice!


Edited by as.yanev - 05 Jun 2011 at 11:41pm
Always aim for the moon, even if you miss, you'll land among the stars...
IP IP Logged
Dewald
Groupie
Groupie
Avatar

Joined: 02 Jun 2011
Location: South Africa
Online Status: Offline
Posts: 47
Quote Dewald Replybullet Posted: 06 Jun 2011 at 1:03am
Why do you not just use a record selection?
Dewald Botha
http://www.ITClarity.co.za
IP IP Logged
as.yanev
Newbie
Newbie


Joined: 05 Jun 2011
Location: Bulgaria
Online Status: Offline
Posts: 4
Quote as.yanev Replybullet Posted: 06 Jun 2011 at 11:12pm
Originally posted by Dewald

Why do you not just use a record selection?

I tried, but I have problem with the inner join  Ouch
Command for the report is :

SELECT `TagCfg`.`tgName`, `TagCfg`.`tgDescriptor`, `TagCfg`.`tgDeviceType`, `TagCfg`.`tgDeviceIOadd`, `TagCfg`.`tgOPCItemName`, `ptGlobalTypes`.`tgGlobalTypeCode`, `ptSystemTgTypes`.`SystemTagStr`
FROM   (`TagCfg` `TagCfg` INNER JOIN `ptGlobalTypes` `ptGlobalTypes` ON `TagCfg`.`tgGlobalTypeCode`=`ptGlobalTypes`.`tgGlobalTypeCode`)
INNER JOIN `ptSystemTgTypes` `ptSystemTgTypes` ON `TagCfg`.`tgTypeCode`=`ptSystemTgTypes`.`tgSystemTagCode`


I don't know where to set `tgGlobalTypeCode`= 0. 
Always aim for the moon, even if you miss, you'll land among the stars...
IP IP Logged
Dewald
Groupie
Groupie
Avatar

Joined: 02 Jun 2011
Location: South Africa
Online Status: Offline
Posts: 47
Quote Dewald Replybullet Posted: 06 Jun 2011 at 11:25pm
In crystal, go to the select expert. Create a new condition, pick the tgGlobalTypeCode from the list and select equals and type 0.
Dewald Botha
http://www.ITClarity.co.za
IP IP Logged
as.yanev
Newbie
Newbie


Joined: 05 Jun 2011
Location: Bulgaria
Online Status: Offline
Posts: 4
Quote as.yanev Replybullet Posted: 06 Jun 2011 at 11:29pm
Thanks Man! It's much easier than i thought...Clap

Edited by as.yanev - 06 Jun 2011 at 11:30pm
Always aim for the moon, even if you miss, you'll land among the stars...
IP IP Logged
Dewald
Groupie
Groupie
Avatar

Joined: 02 Jun 2011
Location: South Africa
Online Status: Offline
Posts: 47
Quote Dewald Replybullet Posted: 07 Jun 2011 at 12:11am
You're welcome
Dewald Botha
http://www.ITClarity.co.za
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.016 seconds.