Skip to main content
Solved

Passing variable from a subreport gets out of sync if subreport tables have no records

  • 26 September 2022
  • 4 replies
  • 119 views

Hello,

I am passing a variable from a subreport back to the main report.

This is working with one problem.

If the subreport has no records to report, the variable being passed back to the main report is wrong.

The variable should always report the value from the subreport for the current record.

The subreport itself prints correctly, but the variable appears to be from the previous record’s subreport value.

 

4 replies

Userlevel 7
Badge +4

@ltussing03 Does this report require use of variables or can the actual data fields be used instead?
If it is just looking for a single value off a populated field then I think removing the variable and just using whichever field is calling in the value should work.

Otherwise you may want to check where the group is getting defined and possibly check the Process Order to see if this can make a difference.

Variables are a little challenging sometimes but if you want to share the report and subreport I can check it (providing it has data which can populate based on Sales Demo data).
Otherwise it might help to also see the variable configuration and the subreport configuration

Userlevel 6
Badge +6

Ben,

This was to gather subtotal where a many to many relationship existed between the tables.

I found another way to get this figure without needing to subtotal in a subreport though so this is a moot question for me now.

I sincerely appreciate you taking the time to respond!

Userlevel 3
Badge

Hi @ltussing03 , may I know how do you work around this issue? I am facing the same issue as yours where the sub report is out of sync when there is no record.

Userlevel 6
Badge +6

Erick,  I am sorry.  It has been a year and I don’t recall.  I don’t believe I ever got the subreport to work properly but found another way to get what I needed.

Reply