Link to home
Start Free TrialLog in
Avatar of FCapo
FCapo

asked on

SubReport values

Hi,

I'm trying to build a graphical report using a chart which show the costs of each project in our company, the cost is made up of employeeHours*wageRate and projectExpenses, the expenses are obtained from a subreport in my groupFooterSection and the hours from the summary details in my main report, I used variables to obtain the  total cost  from the subreport. I then added both costs together in a second groupFooterSection.

In my main report footer, I inserted a chart which graphs the costs on the x-axis and the project# on the y axis. The problem I'm having is that only the cost of employeeHours*wageRate is showing up on the x-axis, the projectExpenses from the subreport are not there, even though they're both added up correctly in the second groupFooterSection.

It's as if the chart in the main reports last footer can't consider values from a subreport, is this the case?
Avatar of Mike McCracken
Mike McCracken

That is exactly correct.

Crystal uses a multiple pass method render the report.  Charts are generated in  the WhileReadingRecords pass but subreports are evaluated in the last pass through the report WhilePrintingRecords.  

Thus the data from the subreport is not available when the chart is built.

Why do you need the subreport?
DO you have 2 data sources?

The method described in this document might work
http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/40e7130d-aa1e-2b10-ce9f-eee2a54ff4cd?QuickLink=index&overridelayout=true&29665339124157

mlmcc
Avoiding the use of subreport would simplify things.  You can use an SQL Expression such as:
(SELECT Sum(`ProjExpense`) FROM Expenses as Exp WHERE (`Proj ID` = `ProjHours`.`Proj ID`) )

Open in new window

There are other options as well (VIEW/SP/Command).
Avatar of FCapo

ASKER

The reason I use sub-reports is because I need to list the details section of several aspects of a project: Timesheet, revenue, expenses, lab work.

I then add it all up together to check the profit.

If I add more than 1 details section (A B C), it no longer keeps the grouping per section,

Say I want to show the Timesheet of employee John for project #ST-209, as well as all the bills for that project, clearly there will be more than one record of time entered and more than one bill entered.

But the report will print one record of the timesheet, then one record of the bill, then one record of the timesheet, then one record of the bill, then one record of the timesheet, and so on.

I want All records of the timesheet in one shot, then all records of the bills in one shot

Project# 15478
Bills
Date                      Cost                Description
12/11/2015          $50                  Machinery
12/11/2015          $40                  Transport
12/11/2015          $10                 Delivery
Total                     $100
------------------------------------------------------------------------
Timesheets
Employee John
Date                      Hours             Description
12/11/2015          1                      Writing Report
12/11/2015          1                      Editing Report
12/11/2015          1                      Printing Report
 Total:                   3                          

What the report actually does is :
12/11/2015          $50                  Machinery
12/11/2015          1                      Writing Report
12/11/2015          $40                  Transport
12/11/2015          1                      Editing Report
12/11/2015          $10                 Delivery
12/11/2015          1                      Printing Report

That's why I was using SubReports, it seems to be the only way to do this.?
How do you identify timesheets, Bills etc for the subreports?

mlmcc
Avatar of FCapo

ASKER

Each one has its own table in an access database, I have a table for projects, timesheets, bills, revenue, etc...

They're all connected by the Project #, I was wondering if it was possible in a report to have multiple details sections, such as show me all timesheet, bills, and revenue entries for project #23ke

Without using subreports?
ASKER CERTIFIED SOLUTION
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial