Skip to Content
0
Former Member
Jul 02, 2007 at 10:31 AM

transfer shared variable betweent main report and subrport

36 Views

I have a main report which includes two subreports.If I want to transfer a variable between two subreports, how should I do? It didn't work if I used the following way:

First, I set a shared variable in one subreport:

shared datetimevar date:="database field";

Second, set a shared variable in the main subreport:

shared datetimevar date;

date;

use a parameter to retrieve this variable.

Finally, link this parameter to another subreport.

Position: one subreport is put into Details A, another subreport is put into Details C, a parameter which retrieves the value from subreport is in Details B,and the order is A,B and C.

When the value of shared variable from the subreport changed as database field turns down, it worked well. But strange things happpened when the value was null after several not null values.The subreport exporting data could show the value correctly whether or not the field was null,but main report could not retrieve correct values from subreport.For example, when the shared variable from subreport is not null and changes one by one, the parameter does the same way. When the shared variable is null after not null values, the parameter still shows the last not null value from subreport unless the shared variable is changed.

The point is that the value of parameter can refresh with the shared variable of subreport.