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

How do I pass date parameters to sub reports and use them in the selec

Status
Not open for further replies.
Jun 17, 2010
58
US
has ideas on creating subreport with passing parameters to subreports.

Is there another way to pass ?startdate and ?enddate to a subreport or maybe its better to pass a selection into a subreport. I'm trying to filter "exceptions" to rules i've defined for standards into a subreport that will be reviewed.


with null values set to default for the report options...using this selection formula.

(
{CONTACT2.UCLMNO} > 0 and
(
(
{CONTACT2.UPYMTDATE} >= {?begindate} and
{CONTACT2.UPYMTDATE} <= {?enddate}
)
OR
(
{CONTACT2.URIDATPAID} >= {?begindate} and
{CONTACT2.URIDATPAID} <= {?enddate}
)
OR
(
{CONTACT2.UIIDATPAID} >= {?begindate} and
{CONTACT2.UIIDATPAID} <= {?enddate}
)
OR
(
{CONTACT2.URODATPAID} >= {?begindate} and
{CONTACT2.URODATPAID} <= {?enddate}
)
)
)

I am wanting to get anything within the following 3 fields into the subreport: {CONTACT2.URIDATPAID} {CONTACT2.URODATPAID} {CONTACT2.UIIDATPAID}
 
In subreport create Parameters of same type and name and use with sub report as required.

In Change links, drag Parameter from main report into top right pane.

In bottom left drop down find the parameter with same name and link.

Ian
 
If I remember correctly, only one of the fields is populated per row of data. If this is true, and given that you have converted nulls to default values in report options, I think you could simply for your selection formula to:

{CONTACT2.UCLMNO} > 0 and
maximum([{CONTACT2.UPYMTDATE},{CONTACT2.URIDATPAID},{CONTACT2.UIIDATPAID},{CONTACT2.URODATPAID}]) >= {?begindate} and
maximum([{CONTACT2.UPYMTDATE},{CONTACT2.URIDATPAID},{CONTACT2.UIIDATPAID},{CONTACT2.URODATPAID}]) <= {?enddate}

In the subreport, you could just remove the datefield from the array that you don't want to check. When you set up the links, be sure to use the dropdown in the lower left to select the actual parameter, not the default that starts with {?pm-?.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top