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

Creating a chat on passed value

Status
Not open for further replies.

BradCustom

IS-IT--Management
Oct 5, 2007
296
US
Hi all,
I'm having an issue charting the % of Utilization on my report in Crystal 2011 using an SQL 2008 database​

The chart is on the main report and presently is in the Report Footer. I also had it in the Report Header. It's a simple bar chart.
The "Change Of" is Work_Center.Work_Center
The "Show value(s)" is @WC Utilization % and is not summarized

Main Report
//WC Utilization %
{@PassWCHours}/{@CapicityHoursWeekDay}*100

Main Report
//PassWCHours
whileprintingrecords;
shared numberVar WCHours;
WCHours

//Subreport formula PassWorkCenterHours
whileprintingrecords;
shared numbervar WCHours := if isnull ({@HoursWorked}) then 0 else Sum ({@HoursWorked}, {Transaction_Detail.Work_Center})

Main Report
//CapicityHoursWeekDay
if GroupName ({Work_Center.Work_Center})="quality" then (({@WeekDaysForDateRange}*9)*3)+ ({@SaturdaysForDateRange}*5) else

if {Shift.Shift_Name}="NIGHT4PM" then ({@WeekDaysForDateRange}*18)+ ({@SaturdaysForDateRange}*5) else
({@WeekDaysForDateRange}*9)+ ({@SaturdaysForDateRange}*5)


Regardless of where I place this chart all I get is the Work_Centers the Utilization percentage doesn't chart. Does anyone have any ideas.
Thanks for your help!
 
Charts happen before subreports so you can't really chart on a formula that involves shared variables coming from subreports.

There is a workaround that works in some cases. You do the calculation and chart in the subreport:
1) Go into the subreport that currently calculates the shared variable
2) Add a parameter to that subreport called CapicityHoursWeekDay
3) Use that parameter to do the main report calculation, but in the subreport (without variables).
4) Use that calculation do the chart in the subreport.
5) Link the new subreport parameter to the formula in the main report


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top