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

chart based on a variable from a subreport

Status
Not open for further replies.

jj1576

MIS
May 21, 2008
69
US
I'm trying to comfirm if there is indeed no way to do this or if there is a complicated work-around. I have a report that has 11 sub-reports- I have a graph in one of the sub-reports that is based on a shared variable from one of the other sub-reports.

Of course, because it is a print time formula the graph will not let me use this formula. I've heard that CRChart can do this, but I am trying (for now) to avoid the $500.00 it costs. Has anyone heard of a way around this & if not, can CRChart indeed accomplish this?

Thanks in advance.
 
You say you have a graph--did it ever work? Also please show the formula you want to use in the graph.

-LB
 
The formula is as follows=

whileprintingrecords;
shared numbervar totalc:=
shared numbervar matha - shared numbervar mathb;

matha and mathb are from the 1st and 2nd sub-reports and this formula is in the 3rd. These all display above the graph I'm trying to make. The graph would not give me the choice to include the formula- so I couldn't actually make the graph- sorry if that was misleading, I don't actually have the graph yet, but I need to include it.
 
I have found that to use a shared variable in a chart I must not have added the formula to the report--I create the formula referencing the shared variable, and then it appears in the field list for charting. Then I add it to the summary area, and then notice that the field list no longer contains it. So, if necessary, start a new subreport for the chart.

There is a technical paper on this called "Charting on Print-time Formulas" meant for V.9.0 but it is still relevant. See if you can find it on the new SAP/BO support pages. If you get a screen requiring a login/password, just hit OK and proceed to the technical papers for Crystal Reports.

-LB
 
lbass,

Thanks again for the reply. I tried the Business objects work around and I have the graph showing the values on
the formula @subshowvalue

tonumber(split({?Pm-@Show Value}, "^")[recordnumber])

The Show value formula is as follows:

stringvar strShowValue;
strShowValue := strShowValue + totext({@Total C}) + "^"

is there a way to reset this formula on the change of a certain field? For some reason when I do an average in this graph it does the average for every item(The display on the second graph in the group is including in it's average records from the first). In other words the I need to reset this running total on the change of a specific field.
 
I'm not sure--are you resetting the value per group in the subreport where the show value is being accumulated? Is that what the second formula is showing me?--but it doesn't appear as a shared variable, so I'm unsure.

Also, in some cases it is appropriate to use groupnumber instead of recordnumber in the split formula--but again I don't have enough info.

-LB
 
Yeah- I'm trying to reset the value in the sub-report when group #4 changes. I'm thinking there must code to reset the total on the change of the field that would be added to the second formula. The second formula is telling the chart what to use for it's data. The @totalc formula references a shared variable.
 
There is a separate step for creating (in the first sub) and bringing the 'on change of' value into the chart. Try looking at the article.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top