Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: if then wtf? Post Reply Post New Topic
Author Message
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Topic: if then wtf?
     Posted: 06 Jan 2012 at 3:05am
I'm really new to Writing Crystal Reports. 

I have a report that I want to show cost and extended cost.  I would like it if the extended cost is blank if its a quantity of 1 

I have

if qty = 1
then ""
else
qty*cost

any ideas?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jan 2012 at 4:27am
You cannot have two different data types in your result
(if table.quantity=1 then 0 else table.quantity)*table.cost

Then conditionally suprpress the formula field when it is zero
Currentfieldvalue=0
IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 06 Jan 2012 at 8:57am
Ok.  Thanks for that.

Now I have two more questions. 

First is about parameters.  I have a parameter set so my users can select a product class.  Multiple product classes can be chosen if desired.  I have a section of the report that shows what paramters have been selected.  If more than one choice is made I only see one of the selections.  How can I see all of the selections made.

Second Question,

This report also has a field for warehouses.  If there is ware house then I want the phrase W.O. Purchase to show.  How can I format that?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jan 2012 at 1:48pm
For the product class use JOIN.
Example:
Join(?param,", ")

Not sure I understand your second question...
If you have a not null value you can write a formula to create a string

If not isnull(table.warehouse) then "W.O. Purchase"
IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 10 Jan 2012 at 2:37am
Thanks for all of the help so far.  My report works as planned. 

My next question concerns a logo.  I have a report that needs to have two separate logos.  I would like one logo to print if (table.date) is before 12/31/2011.  I would like another logo to print if (table.date) is after 1/1/2012. 

How can I format the objects to act this way?   
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2012 at 3:55am
i believe you can either make a dynamic image location path or just place both images in the report and use a conditional suppression on each based on your date critera
image1
table.date>date(2011,12,31)
image2
table.date<=date(2011,12,31)
IP IP Logged
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