简体   繁体   中英

Shared variable is executing after subreport Crystal Reports

I'm using Crystal Reports 14. I have a master report containing only details section, filled from 3 sub reports. The detail section is a single page per record, filtered by Employee ID. That means that when the Employee ID 100 is displayed on the master report, the other 3 sub reports show details from the Employee with ID 100. I have a shared variable, that sum's an amount from a sub report, and it is displayed on a different area on Master report detail section.

this is the code on Master report

Shared NumberVar x;    

And this is the code on Subreport

Shared NumberVar x:= (Sum ({Command.amount}));    

The problem is that when i display Employee ID 100 the first value is 0. On the next page i get the value of the previous employee ID and so on.

If my assumption is correct, this may have to do with sub report value is executing after Master report. Having only details section and page per record this is a bummer

Any ideas?

Place shared variable in a different section than your subreport is. Put your sureport in a section above your main report is and go to details section expert and check underlay section below.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM