• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

Crystal Reports Formula in CrossTab Report

I want to enter a formula in my report to rename a field but I'm not sure how I do this when this field is used in a Cross Tab.

mechtest2.rpt subreport is  showing running total fields of which on field is called Coating Type.  Because there's not enough space to display some of these names, I created a formula (CoatName) to rename them.    But I can't figure out where I would tell it to use @CoatName

Mechanical-Test---Main-Report.rptMechanical-Test---Main-Report.rpt
CoatName.png
0
ITworks
Asked:
ITworks
  • 3
  • 3
1 Solution
 
mlmccCommented:
Just use it in the cross tab in place of the field it is updating

mlmcc
0
 
ITworksAuthor Commented:
I think I explained it wrong.  This portion of the report is a running total field.

I have a formula called coating that is:

  global stringvar coating;
if {Command.Name} = "Coating Type" then coating:={Command.displayvalue} else ''

The running total field to summarize is @coating

Then I created a formula called CoatName that reads:

if{Command.Name} = "Hot Dip Galvanized per ASTM A153" then
"HDG A153"
else if{Command.Name} = "Mechanically Galvanized" then
"MechGalv"
else if{Command.Name} = "Hot Dip Galvanized" then
"HDG"
else if {Command.Name} = "Plain" then
"Plain"
else if {Command.Name} = "ISO 10684" then
"ISO 10684"

CoatName is used to shorten the names so that they will display in my report better.
0
 
mlmccCommented:
Can you save the report with data or provide a screen shot so I can see the issue?

mlmcc
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ITworksAuthor Commented:
0
 
mlmccCommented:
I think your CoatName formula should use Command.DisplayValue  not Command.Name for the test.

You could then change the coating formula to

global stringvar coating;
if {Command.Name} = "Coating Type" then coating:= {@CoatName} else ''

One other comment, since the variables aren't used in other formulas you could change the formulas so they don't use them

if {Command.Name} = "Coating Type" then  {@CoatName} else ''


mlmcc
0
 
ITworksAuthor Commented:
Thanks!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now