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?
FCapoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
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
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
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).
FCapoAuthor Commented:
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.?
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

mlmccCommented:
How do you identify timesheets, Bills etc for the subreports?

mlmcc
FCapoAuthor Commented:
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?
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
If these are tables in Access, it would be simple to create queries that return summary info (Group By Project).  In the main report, you would then join to these queries. Since each project would have only one row in the summary queries, no record inflation and no need for subreports.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
You can't have separate detail section in that sense.  YOu can group by the type.

You could take the queries from the subreports and union them together in a COMMAND or a view in Access.

mlmcc
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.