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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart with multiple parameters problem 2

Status
Not open for further replies.

Haloman

Technical User
Mar 5, 2008
21
US
Hi all,

I am new to crystal reports and I had a question regarding charts. In the report I'm trying to make, there is a single graph with four parameters on the Y axis plotted against datetime. The user selects the parameters that needs to be plotted against datetime. When the user selects all the four parameters, I do not have any problems. But when the user selects less than 4 (say 2 of them), then crystal report automatically assigns zero to the other two parameters. So the shape of the graph is very misleading as the 2 parameters which the user din't select is also displayed as zero in the graph.

Is there any way to leave out the parameters out of the graph if the user has not selected them? Or is it possible to assign null values to the parameters that are not selected so that they don't show up in the graph? Any pointers would be greatly helpful.

I am using crystal version 11.0

Thanks for your help.
 
Can you explain how you set the parameters up to use them in the chart? Please show the content of the formulas you used.

-LB
 
This is how I have currently set up the data in the chart.

In the chart expert, under the data tab, I have used the following set up.

- I have used "On change of" @datetime
- For show values section, I have used @param1,@param2,@param3 and @param4. I have also checked the Don't Summarize box.

Now the formula values for datetime and the four parameters are below.

datetime - totext({TABLEA.DATE_TIME},"MM/dd/yyyy hh:mm")

Param1 - IF "Param1" IN {?Plot parameters} THEN
{TABLEA.PARAM1};

Param2, Param3 and Param4 have similar code as Param1 but for the corresponding column names.

Plot parameters is the input given by the user from a list box and can select more than one parameter at the same time.

So when the user selects two parameters from this list, Crystal automatically assigns 0 to the other two parameters and plots them in the graph. I wanted to know if there is any way to plot only the parameters selected by the user in a single graph? Any pointers would be greatly helpful :)

Thanks a lot.
 
Create a formula {@null} by opening and saving a new formula without entering anything. Then change your parameter formulas to:

IF "Param1" IN {?Plot parameters} THEN
{TABLEA.PARAM1} else
tonumber({@null})

This will eliminate the zero values. However, I think the label might still appear--I didn't test this.

-LB
 
Hi LB,

Thanks a lot for the update. It resolved the problem :). The labels for the zero values are showing up but I guess that is a minor issue. This solution saved a lot of my time.Thanks again :)

HM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top