Topic: Failure in passing shared variable to subreport Posted: 29 Apr 2014 at 2:58am
Hello team,
I need your assistant in passing a database field called {engine.rptno} to the subreport select expert from the main report. I tried to use shared variable in the main report.
I created a formula in the main report
shared numbervar report_number := {engine.rptno};
report_number;
In the sub report, I create a formula ("Shared_report_number") and I placed it in the report header. It has the code:
shared numbervar report_number;
report_number;
I clicked on Select Expert and then I chose the field {engine.rptno} is equal to {@Shared_report_number}, it produces an error that : the formula cannot be used because it must be evaluated later
Can you please help me in this.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 30 Apr 2014 at 5:34am
record selection occurs during the data read, which is one of the first passes through the data. Shared variables are only populated at print time...which is later in the passes through the data.
Basically, as the error state, the shared variable is not populated in time to be used as in the selection criteria...even though it is a subreport.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum