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!

variable come from subreport could not be summarized

Status
Not open for further replies.

francesguan

Technical User
Jan 26, 2006
52
CA
Hi,
I defined the variable in subreport, and used in mainreport, looks good till I need to create a summarization for this field. it tells me: this field can not be summarized.
Is it true that variables from subreport can not be "Total" any more?
how can I get that "total"?

any kind of comments are appreciated,

Frances
 
What kind of total? If you want to sum amounts from a shared variable from a subreport, you would use a set of formulas:

//{@accum} to be placed in the section containing subamt (below the section containing the subreport):
whileprintingrecords;
shared numbervar subamt;
numbervar sumsubamt := sumsubamt + subamt;

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar sumsubamt;

You should also have a reset formula for the shared variable in the same group, but in a section before the one containing the subreport, e.g., in GH1a if the subreport is in GH1b:

whileprintingrecords;
shared numbervar subamt := 0;

-LB
 
LB,
Thanks for your feed back.

the "total" I need is for all the items, while mainreport linked to the subreport with item, so I can not get a sumsubamt from subreport directly. I need to total them in main report.

do you think it's possible?

Frances
 
Just create a manual sum of it back in the main report.

AFter the subreport has fired, place a formula such as:

whileprintingrecords;
shared numbervar MySubValue
numbervwar MyMainTotal:=MyMainTotal+MySubValue

Then you can display the total in th main report footer as in:

whileprintingrecords;
numbervwar MyMainTotal

Your post doesn't state anything technical, such as where the subreport is, or where you are intending to display the total.

A poster intentionally excluding technical information should expect theoretical answers only, if you want specifics, please take the time to post specifics.

-k
 
LB,
I will try to make it specific and understandable:

in subreport I have 2 variables in Report Footer:
@totalopenqty=
whileprintingrecords;
shared numbervar totalopenqty:=Sum ({poitem.qty_ordered})-Sum ({poitem.qty_received});

@OpenInvestment=
whileprintingrecords;
shared numbervar OpenInvestment:={@totalopenqty}*{poitem.item_cost};


in Main report

GH#1a
whileprintingrecords;
shared numbervar OpenInvestment:=0;

GH#1b
subreport

GH#1c
whileprintingrecords;
shared numbervar OpenInvestment;

then, I try to get total of OpenInvestment in report footer in main report.and I can not. it tells this field can not be summarized.

Thanks,
 
Please use the formulas that I provided in my first post, as in:

//{@accum} to be placed in GH#1c:
whileprintingrecords;
shared numbervar OpenInvestment;
numbervar sumsubamt := sumsubamt + OpenInvestment;

Then in the report footer, add this formula:

whileprintingrecords;
numbervar sumsubamt;

-LB

 
Thanks,LB, I can only see the result tomorrow. we run it in midnight. I will follow on ...Thanks,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top