Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to put labels on x-axis when no data for an item?
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
How to put labels on x-axis when no data for an item?
Miscellaneous
Thread ID:
00699464
Message ID:
00699464
Views:
70
I have a Crystal Report chart with an x-axis and y-axis.

On the x-axis I want labels in minutes from 0 to 20 across the bottom below the x-axis line using labels such as 0 min., 1 min., 2 min., 3 min., and so on up to 20.

The problem is that the data does not have any value for 1 min. or 3 min. so when I preview the chart I see 2 min., 4 min., 5 min., 6 min., and so on up to 12 min. for the x-axis labels?

How can I get around this problem without touching the data to fake out the report? Thanks for the help.

I found on the Crystal website where I could write a VB routine to make this work, but I have not tried it. I was wondering if there was a way I could take the VB routine and plug it directly into a Crystal formula and skip the VB formula and re-write the formula in Crystal or something

Here is what the VB code looks like
'@date
'thisdate and nextdate will be used to determine if gaps exist in the database
dim thisdate as date;
dim nextdate as date;

'output will be used to create the on-screen formula display
dim output as string

thisdate={master.date}+1;
nextdate=nextvalue{master.date};

do while nextrdate - thisdate > 0;
output = output + totext(thisdate, "mm/dd/yyyy") + chr(10);
thisdate = thisdate + 1;
loop;

formula = output;

'output is creating a string running total to create the dates which do not exist
'the chr(10) in output creates a new line for each new date created
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Next
Reply
Map
View

Click here to load this message in the networking platform