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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter problem

Status
Not open for further replies.

OLTU

Technical User
Feb 14, 2005
39
NL
Hi there,

I'm using version 8.5

I have a problem with parameter fields,

Is there a way to use a formula (from subreport)as a
parameter field?

Example:
In my subreport I've formula
@Date to mainreport;
if not(isnull(Maximum (POST.EFFECTIVEDATE}, {POST.EFFECTIVEDATE}, "daily")))then
shared datetimevar dat:= Maximum (POST.EFFECTIVEDATE}, {POST.EFFECTIVEDATE}, "daily")

and in main report formula
@Date from subreport;
whileprintingrecords;
shared datetimevar dat;

now I'm trying to say;
@Senddate(this my parameter field name)=@Date from subreport

but I'm getting the below error message when trying to save

"This formula cannot be used because it must be evaluated later."

thx for your time


 
If you think about this, a subreport fires AFTER the main report, so you wouldn't use a subreport value at the start of a main report.

And your formula wouldn't work anyway, it only occurs during a certain condition, and at a group level, parameters aren't at a group level. And then you say ultimately you're trying to set a parameter to a date, which will do nothing, ultimately you need to set a field in your database to a value (parameter or otherwise).

I suggest that you reverse which is the main report, and then you might pass that value to the subreport (currently main) as a parameter in the group footer, but the whole logic is a convoluted, consider doing the equivalent in SQL on the database in a View or a stored procedure.

If your intent is to only display the maximum value for some date for each group then use the Report->Select Formula->group and place that logic there, as in:

{table.field} = Maximum (POST.EFFECTIVEDATE}, {POST.EFFECTIVEDATE})

and display it in the subreport.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top