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

Problem with null or nonnumeric values with charting print time values 1

Status
Not open for further replies.

hansdebadde

Technical User
Jan 20, 2005
214
CA
I am using CR2008, my data is in SQL. I am trying to chart some print time formulas. I have done this successfully before and am using the BO PDF document that illustrates how to do this. The problem is when i try to chart or crosstab my data it either says the value is non numeric or the array has to be between 1 and the size of the array.
Basically i have OnChangeOf and ShowValue that are passed into the subreport, but are not linked to a field.
I can show the OnChangeOf in the crosstabs or charts.
ShowValue is the issue:
//@ShowValue
shared numbervar qtr;
shared numbervar num;
shared stringvar strShowValue;

strShowValue:=strShowValue+totext((if qtr>0 and num>0 then qtr/num))+"^";

In the subreport i have a formula
//@Showvalue
tonumber(split({?Pm-@ShowValue}, "^")[RecordNumber])

When i just put the ?Pm-@ShowValue field in the subreport i see the klnd of values i expect, numeric with ^ between values. Is it because of some hidden null value or something? I am stuck. Can anyone help?
 
You don't really need to check if qtr is > 0. I would have written this as:

shared numbervar qtr;
shared numbervar num;
shared stringvar strShowValue;
if num > 0 then
strShowValue:=strShowValue+totext(qtr/num)+"^" else
strShowValue := strShowValue;

Depending upon your report, it might be accurate to use groupnumber instead of recordnumber in your subreport formula.

-LB
 
Thats it, i forgot to have the same groups in my subreport. I then changed it to Groupnumber and it worked. I knew you would find something simple like that, but i couldn't for the life of me think of it. Thanks for coming to my aid again.
 
I just had the same problem again with another report and i needed to use group number again, LB, how did you know that? i am trying to understand the process better...but my brain is not getting it
 
If the chart is showing values on change of some group then it made sense that there should be the groupnumber number of values.

-LB
 
Thanks, it was not obvious to me though as the chart is in the header of the subreport, not in a Group footer or something. It seems like i have learned so much of this program in the last 7 years, and a few versions, a lot due to your help, but there is still so much....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top