Solved

Changing Titles in Crystal Reports

Posted on 2007-03-29
9
746 Views
Last Modified: 2008-02-01
Using Crystal Reports XI Developer:

Is there anyway to override/change the field names displayed in graphs?
I know you can change the Chart Title, and the Titles on the X and Y Axes, but what about the actual value names for each element on the X and Y Axes?
0
Comment
Question by:P1ST0LPETE
  • 5
  • 4
9 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 18816421
What do you mean the value names?

mlmcc
0
 
LVL 10

Author Comment

by:P1ST0LPETE
ID: 18816581
I'll have to explain a little for it to make more sense.
I work for a consulting company that does a lot of surveys.  All the survey questions for every survey are all in one database table.  The result of this is that question #1 on Survey #13 may actually be question # 1117 on the database; or question #2 or survey #5 may be question #456 on the database.  

Under these circumstances, when I create a bar-graph showing answers for question 1 on survey 13, the graph has question #1 labeled as #1117.  I'm just wondering if there is a way in Crystal Reports to change what is displayed there.  You can do aliases for field names, but can you for actual data? :-)

If there is no solution in Crystal Reports I'm going to have to play with the actual database.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18818170
I assume you have a group in the report to do the totals

Is there a table that maps the Survey Question # to the real question?

Try this
Right click the group header of the left margin in the group
Click CHANGE GROUP
Select the CUSTOMIZE GROUP NAME FIELD
You could use a formula like
IF {QuestionNumber} = "#1117" then
  "#13"
ELSE IF etc

A better way would be to use the real question number field if there is a table.

mlmcc
0
 
LVL 10

Author Comment

by:P1ST0LPETE
ID: 18823799
Currently there isn't a table that maps the Survey Questions to the real questions.  We're using server side programming to do that converting for the actual surveys.  I also agree that one way to do it would be to set up a table to map the change, but for now I'd like to stay away from the database.

On the otherhand, your suggestion to use the if statement formula seems like just the ticket.  I'm currently trying it, and getting hung up.  The formula I'm using looks like this:

         If {questionid} = 1117 then {questionid} = 1;

I'm using the check formula button, and it's telling me " The formula result must be a string".  So I put quotes around the 1 and it then tells me I need a number there.  (The actual data type in the database is NUMBER).  So I thought I may need to convert the result to a string, so I tried:

          If{questionid} = 1117 then {questionid} = CStr (1);

To this, the same error was given, saying I need a number where "CStr (1)" is.

Any ideas?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 18824253
You can't change the database field which is what you are trying to do.

A formula simply returns a value and you put the formula on the report instaed of the {questionid} field.

Your formula for survey 13 will look like

IF {questionid} = "1" then
  "117"
ELSE IF {questionid} = "2" then
  "456"
etc

UNfortunately you will require a different formula for each survey thus my idea of a table that has
Survey#    Question#    RealQuestion#
    13                 1                  1117
    13                 2                     65

mlmcc
mlmcc
0
 
LVL 10

Author Comment

by:P1ST0LPETE
ID: 18824486
I finally got your formula to work.  Had to take the quotes off the first number:

If {questionid} = 1117 then "1"
ELSE IF
etc

Which works great by the way.  One more problem though......The chart that I have reflecting this data is still showing 1117 insteaf of 1.  Can we alter the chart ?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18825194
How are you providing the data?

mlmcc
0
 
LVL 10

Author Comment

by:P1ST0LPETE
ID: 18825527
The Survey is taken by 20-30 people groups usuall.

Off of the data, the charts will show the average answer for each question.  (On the actual Survey, there are 5 radio buttons (1-5) to select from for each question.)

So for example, right now my bar-graph chart looks something like this:

5
4
3
2
1
      1117  |  1118  |  1119  |  1120  |  1121  |  1122  |  1123  |

While I'd like the 1117-1123 to be replaced with 1 | 2 | 3 | 4 | 5 | 6 | 7 |

I was hoping that Group Name formula would carry to the chart, but it is not.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18825641
Glad i could help

mlmcc
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SLQ View not updating 10 47
sql query 7 35
SQL 2012 and SQL 2014 always on 9 25
Ranking Based On Value 3 29
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

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

24 Experts available now in Live!

Get 1:1 Help Now