Solved

Crystal Reports Formula in CrossTab Report

Posted on 2015-01-13
6
309 Views
Last Modified: 2015-01-14
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
Comment
Question by:ITworks
  • 3
  • 3
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40548289
Just use it in the cross tab in place of the field it is updating

mlmcc
0
 
LVL 4

Author Comment

by:ITworks
ID: 40548930
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 40549149
Can you save the report with data or provide a screen shot so I can see the issue?

mlmcc
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Author Comment

by:ITworks
ID: 40549271
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40549667
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
 
LVL 4

Author Closing Comment

by:ITworks
ID: 40549684
Thanks!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now