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

Have to control on sequence of Subreport of execution.

Status
Not open for further replies.

nag999

Programmer
Apr 16, 2003
33
IN
Hi Everybody,

I had a problem related to sequence of execution of subreports.
I have 4 subreports

SubReport1
SubReport2
SubReport3
SubReport4

But I have Shared Variables which collection values in it in each 2nd,3rd and 4th sub-reports. There we collect value
in Subreport 2, Subreport 3 and Subreport 4. But I want to display a formula in Subreport 1 which
actually calculates the total of those shared variables. But I found that the mode of execution is in below sequence.

Subreport 1
Subreport 2
Subreport 3
Subreport 4

This way I am getting the total sum as 0. As it is the intial values it is showing up. How can we restrict
this subreport to get executed after all the remaining three subreports are executed.

Any help is really appreciated.

Thanks,
Nagaraj
 
You should have each subreport in an individual section, and do not call a shared variable until the section after the subreport which contributes to the variable has completed.

Naith
 
Hi Naith,

I had tried them kept each of them in individual section.

So for 4 sub reports i created 4 sections each hold the subreport with a shared variable.I created a 5th section and created a forumla which adds the 3 Subreport Shared values. I had another forumla in Section 1 which basically show the total variable by saying as below.

EvaluateAfter({@sec5Forumla});
GrandTotal;

But this is forcing the section1 and section 5 values to be shown as 0. If we suppress, It is showing correct values in section5.

How to get rid of this problem?

Thanks,
Nagaraj
 
Are you telling me that you have this going on:

Section A
[Subreport 1] [@Call to Shared Variable 1]

Section B
[Subreport 2] [@Call to Shared Variable 2]

Section C
[Subreport 3] [@Call to Shared Variable 3]
...etc.

You cannot call shared variables until after the subreport section has completed. What you have should look more like this:

Section A
[Subreport 1]

Section B
[@Call to Shared Variable 1] [Subreport 2]

Section C
[@Call to Shared Variable 2] [Subreport 3]

Naith
 
If you are trying to get the total of the shared variables to appear in the section before the sections which contain the subreport, you cannot do this, as the order of processing makes it impossible.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top