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

Reterive data from subreport to main report 1

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
Hi

I have a field "Order_detail" that at any given instance has only 2 records and it is placed in the detail section of the subreport which is placed in the "detail B" section of the main report.

Subreport A:
Detail section: Order Detail- 100
200

Now I need to pass both these individual record values (order_detail: 100, 200) from the detail section of the subreport to "detail B" section of the main report to 2 formulas (formula 1 and formula2).

Please suggest how is this possible.

Main Report (Design):
-----------------------------------------------------------
Detail B-
Formula-1: 100 Formula-2: 200
Subreport A
Order_details: 100
200
-----------------------------------------------------------
Report Footer

Please suggest the best approach in this

Rajan
 
Do you need to work with these values in the main report or do you only need to display them horizontally?

-LB
 
Hi Ibass,

I need to display these numbers (100 and 200) in the main report horizontally as well as display in the subreport.

The design is like this;

Main Report:

RH
-------------------
PH
-------------------
Detail A
Customer name, product etc...
-------------------
Detail B
Formula-1 (display 100) Formula-2 (display 200)

Subreport
RH
Details
Order Detail (100), Qty
Order detail (200), Qty
RF
-------------------
Report Footer
-------------------
Page footer

Please suggest how I could display the values from the detail section of the subreport to the detail section of the main report.

Thanks
Rajan
 
I tried using shared variables in subreport. I think I am doing some mistake.

Subreport Header:
whileprintingrecords;
shared numbervar rowct;
shared numbervar count1;
rowct:={sp_order.order_details};
count1:=rowct;
count1;

Subreport Detail section:
whileprintingrecords;
shared numbervar rowct;
rowct:={sp_order.order_details};
rowct;

Subreport Footer:

Formula1-
whileprintingrecords;
shared numbervar count1;
count1;
Formula2-
whileprintingrecords;
shared numbervar rowct;
rowct;

when I do this I am able to view 100 in formula2 and 200 in formula1. But when I call this in the main report I am getting only 0.

In main report detail section:
Formula-1:
Whileprintingrecords;
shared numbervar rowct;
rowct;

similarily for formula-2 also.

Please suggest
 
when using shared variables, the values will be available for display in a section below that which contains the subreport
 
please suggest how I could display the values from subreport to main report in the same section where the subreport is placed.
 
you can only display them below the subreport, so you would need to insert a second instance of the subreport above the section in which you need the values to show, then suppress it so that it is not visible but still shares the values up.

 
Another way you might be able to pass the values successfully is if you have sub in detail_b, but format it to underlay following sections. Stretch the detail_b section and move the sub so that it allows space at the top for detail_c to display (where you have placed the shared variables).

-LB

 
Thank you Ibass, the concept of underlay works good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top