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

Passing Date Selections into Subreports

Status
Not open for further replies.

PBS2

Programmer
May 17, 2004
43
GB
I have a main report which has 3 separate Subreports. The main report has 2 formulas @FromDate and @ToDate which are passed into the report as parameters. I then want to use the values of @FromDate and @Todate as start and end dates for the record selection in each of the 3 subreports. I have tried using shared variables, however, I get problems with the evaluation time of the formula for Subreport record selection. Can I use Subreport Linking - at the moment my Subreports are unlinked.

Alternatively is it possible to pass parameters directly into the subreports from my calling application?

 
You should be able to use Subreport Linking - you'll find it under Edit on the menu. Note that any link you make will generate a statement in the subreport's record selection. Check to see if this is what you want.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Yes - I have looked at Subreport linking but do not fully understand what I need to do. Could anyone give me a beginers course in how to use this feature to solve my problem.
 
You choose a field and then find something to match it to. It should give you a sensible choice.

You will now find that the value from the main report is present in the subreport, preceeded by Pm?. It will be visible from Formula fields and can be used there. Or in record selection.

Links can be made using parameters, data fields and some formula fields; I think it has to be formula fields that do not include any summary functions, but I could be wrong on this.

As well as passing data to the subreport, you might want to pass it back for further processing in the main report. This involves Shared Variables and you can find a lot about those using the Search function on this forum.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top