Solved

Passing data between Main Report and Sub Report

Posted on 2008-10-09
4
1,097 Views
Last Modified: 2013-11-15
I have a report with the following layout:

Details a       Field from SQL Command
Details b      Field from SQL Command
Details c      Field from SQL Command
Details d      Field from SQL Command
Details e      SubReport A

Report Footer b      SubReport B

How do I add the total number of items in SubReport B + the total number of records displayed in Details a-d and display that value in the Page Footer?
0
Comment
Question by:Ray Turner
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
Does each record have a field in details A-D?

In the main report headeer add a formula

WhilePrintingRecords;
Shared NumberVar SubBRecordCount;

In the subreport B
WhilePrintingRecords;
Shared NumberVar SubBRecordCount;
SubBRecordCount := Count({SomeDatabaseField});
''

In the main report footer
WhilePrintingRecords;
Shared NumberVar SubBRecordCount;
SubBRecordCount + Count(SomeFieldinMain}) * 4

If there may be nulls in the main report database fields then

WhilePrintingRecords;
Shared NumberVar SubBRecordCount;
SubBRecordCount + Count(FieldForDetailA}) + Count(FieldForDetailB}) + Count(FieldForDetailC}) + Count(FieldForDetailD})

mlmcc
0
 

Author Closing Comment

by:Ray Turner
Comment Utility
Thanks!!!
0
 

Expert Comment

by:angel7170
Comment Utility
Hello,

Please advice, how can I Hide/Suppress the subreport and do a count of records from the subreport to be passed into main report?
Simply I need the count and not the Details.  Thank you so much
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
String to Date Formula Failure 2 38
Not Exists 3 52
Crystal Reports last day of month 2 33
Crystal Report for VS2013 17 36
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now