Solved

Changing Titles in Crystal Reports

Posted on 2007-03-29
9
747 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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

914 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

21 Experts available now in Live!

Get 1:1 Help Now