Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for Report Title 1

Status
Not open for further replies.

graphix03

Technical User
Oct 8, 2003
189
US
Hi, I use crystal 8.5 and I need to create a report tile
for a report I have. this reports have a parameter of
@state). I need to be able to
have the report tile says something like this:

Production Report for

then next to the word for is the formula something like:
iif(@state is null, @state, "All States")

The reason for this is if the user enter a state, then
whatever the state the user chose, it should appear
on that title next to the word "for". if they leave blank,
then the report should say for All States.

I used the ReportTitle field (in the special field selection), but it does not allow to put in the formula,
so I create a formula field and put the above statement in, but I don't think IIF works for Crystal. it works for Access.

Do you know how I can go about creating this dynamic
report title? any help would be greatly appreciated. thanks much.

 
Hi,
One way is to use place both the parameter field and the static text( 'All States') in the same place ( with exactly the same size) and supress the parameter one if it is null or blank which will show the text.

Instead of IIF,the Crystal syntax for If-then-else is:

If ( somecondition ) then
dosomething
else
dothis

hope it helps
[profile]
 
Hi Turkbear, thanks for your input, you're right.
i just figured it out a short while ago
and it works now. i put it as this:
if isnull({@state}) then "All States" else {@State}.

thanks for your help.
 
Where do you put this formula? I am trying to have a name that changes each time the file is saved. I have the formula, but where exactly do I put it so that the report knows when it is exported to use this formula as the name?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top