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

CR X: Creating a very special bar chart

Status
Not open for further replies.

BarbaraFuhrmann

Programmer
Aug 20, 2002
118
DE
Hi,

we're just about to migrate from CR 8.5 to 10. Just at the moment I am working on a report that has been created under CR 8 and remained unchanged till this time. It includes a bar chart that uses a formula field as specification in the tray "on a change of" (or similar, I don't know it precise because I'm working with the german version). When running this report under CR X an error is reported telling something like "A printing time formula is used in a diagramm that changes a variable. Details: @Detail Value Grid #3 Order".

What I just found out is that neither in CR 8.5 nor in CR X the formula is included in the tray "Available fields". So I think that in CR 8 it was and could be selected, the report performed well with CR 8.5 but now it is not longer working.
If I change the diagramm options by removing the formula and putting in a database field instead it runs.

Here is the contents of the formula:
if {#SUM_PER_BRANCH} > 0 then {database.BRANCH_NAME} else
select {database.BRANCH_NAME}
case "Branch 1" : " "
case "Branch 2" : " "
case "Branch 3" : " "
case "Branch 4" : " "
case "Branch 5" : " "
case "Branch 6" : " "
case "Branch 7" : " "
default: 'Unexpected Branch ??'

How should the chart look like?
The chart shows different values for our branches. A branch shall appear in certain diagramm only if the SUM of the affected value for it is > 0. BUT the colour e.g. for Branch 4 has to be lemon, unless it is the only one displayed in the chart or if there are more. AND every bar shall be of the same width in the whole report, unless there are 7 branches to be displayed in the individual diagramm or only 1.
That was what was achieved with the above formula. By adding a 0-record for every branch when selecting the data for the diagramm every branch was present but it's name underneath the chart was only displayed if the sum was > 0.

I hope you understand what I try to describe.

Now I'm looking for a solution! How can I achieve the result I need? Any ideas?

Thank you
Barbara
 
You could create a view that returns the SUM_PER_BRANCH and join to that View (using branch_name) so that the SUM_PER_BRANCH is known in the first report pass.

You could achieve a similar effect by placing a subreport in the report header and using it to load a shared array variable with the values for each branch, so that in the main report you could lookup the array elements.

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top