Click to See Complete Forum and Search --> : How to: Display summary on a Sub-Report column from Main Report?
hemantvikram
June 26th, 2006, 12:32 PM
Hai...,
I'm using bundled version of the CR that comes with VS.NET 2003. I have designed one of my report that makes use of sub-report. The sub-report i needed is coz i want to display the data horizontally. For example,
Tax1 Tax2 Tax3
----- ----- -----
20 30 40
10 24 46
Ok,
I have added this sub-report to my actual report. Now in the main report how do i show the sum of Tax2
information. Hope my question is clear.
Thanx and Regards,
Hemant
zeeshangodil
June 29th, 2006, 05:00 AM
through parameter fields..
if you are displyaing ur subreport in report header section....
then subreport data can display in main report....detail section or page footer.. or report footer
or if you are displaying ur subreport in report footer... this will not be shown in main report in any section..
as i understand you want to display the summary of main data into sub report...or sub report into main data..
so u need to first order the section.. .as told above....
and then create paramters value in the main report / sub report.. in which u want to show the summarize value of the other report...
and then link these parameters with the summarized or running total fields of the report which have summarize value..
for detail..
email me :zeeshangodil@hotmail.com
best of luck
hemantvikram
June 30th, 2006, 08:06 AM
Hi zeeshangodil,
Yes i'm sorry that my question was bit unclear. I will try to explain in more detail what i want. I have a sub-report named mySubReport.rpt. This sub-report has just a cross-tab that displays state tax information horizontally like:
Tax1 Tax2 Tax3
----- ----- -----
20 30 40
10 24 46
Now, I have used this sub-report in my main report named myMainReport.rpt. In this main report i would like to display the summary report for Tax1. Assume that we get the above tax data for one row in the main report and let us assume the tax data for another row be:
Tax1 Tax2 Tax3
----- ----- -----
40 30 40
50 24 46
Now, the summary of Tax1 in the main report should show Tax1 = 120 (which is sum of All tax1 data for both the records of the main report)
Hope my question is now more clear.
I tried but i think there is no direct way to get this sort of information out of cross-tab i.e like
reportDoc.ReportDefinitions.ReportObjects("subRepObjName").ReportObjects("crossTabName")....
Anyways, that was my question dude and sorry for the delayed reply
kakipopo
June 30th, 2006, 12:44 PM
I kind of have a similar problem. Here's a simple example.
(Main)..............(Main).........(Sub-Rpt)..........(Sub-Rpt)
Category..........Budget.......Expended........Unobiligated
Salaries...............1000.................500......................500
Equipment...........2000...............1500......................500
Supplies................500.................400......................100
Totals..................3500.........????????..............????????
The Budget data is from the main report but the expended and unobligated are from a subreport. How do I get totals for those columns?
I tried to declare those two fields as shared variables in the subreport, placing the variable in a formula in the main report, and then placing it on the main report. This gives me the same data in each of those two columns in the detail, but then i tried to created a sum of that formula in the footer and it gives me an error saying it cant be summarized.
hemantvikram
July 1st, 2006, 01:21 AM
Hai kakipopo,
From your post, i understand that you were able to get the values from the sub-report and show them in the main report and that you were only not able to sum them. Is my understand correct? If yes, then this how you show the summary (the way i do/did). I will take Expended sub-report and try to show you how we display total of those in the main report:
1. In you main report (Category / Budget) declare a formula field named
@InitExpendedTotal. Add the following listing to this formula
Shared numberVar dblExpendedAmount := 0;
Global numberVar dblTotalExpendedAmount := 0;
2. Drag and place this formula to the report header of the main report (Category / Budget). You can suppress this formula to hide it from getting displayed.
3. I assume that you have used a formula to display the value (each expended value) from the sub-report to the main report. Let me assume the name of the formula be @CurrentExpendedAmount.
4. Now create another formula that keeps summing the Expended amount you get each time thru the formula @CurrentExpendedAmount. Lets name this formula as @TotalExpendedAmount. Then add the following listing to this formula
Global numberVar dblTotalExpendedAmount ;
WhilePrintingRecords;
dblTotalExpendedAmount := dblTotalExpendedAmount + {@CurrentExpendedAmount};
dblTotalExpendedAmount
5. Place this formula, @TotalExpendedAmount, where you have placed the formula @CurrentExpendedAmount. Suppress @TotalExpendedAmount from getting it displayed
6. Add one more formula to display the Total Expended Amount to the footer or whereever you wish to place. Let name this formula as @DisplayExpendedTotal. Then add the following listing to this formula
Global numberVar dblTotalExpendedAmount ;
dblTotalExpendedAmount ;
Drag and place this formula where you wish to show the total. Thats it man. Try and let me know how it goes.
Regards,
Hemant
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.