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

Filter not good in subreport

Status
Not open for further replies.

taterday

Programmer
Jan 28, 2009
183
US
I have a filter that is a prompt in the main report. I am passing the date capture as a shared variable. I can not get the subreport to use the same filter that is being used in the main report.

If I put it in the report filter, I get that the information has not be evaluated yet and not be used here error.

I can print the variable in the sub report so I know that it available to be used.

I am filtering on a date range for the main report with project info and employee id being the main sort.

I link the subreport with the employee id. This works. The date I pass is a string date within a shared variable.
In subreport:
Whileprintingrecords;
Shared Stringvar shared_datefrom;
shared_datefrom

This will print on the report. shared_datefrom is a string variable. How do I convert it back to date? The comparsion date in the table is a date.

Any suggestions would be appreciated.
 
If you can, you are better off converting the daterange parameter to start and end date parameters. Then link each parameter to a corresponding parameter that you create in the subreport by using the dropdown in the lower left to select {?Start} instead of the default {?pm-?start}. You should then use the parameters in the subreport selection formula.

-LB
 
Sounds better, but... The user has an interface program that they use to run the reports. I have to use this.

This what the report does. Prints the projects an individual does with the time range charged. Example 4 hours on project A date 04/15/2010. 4 hours on project A date 04/16/2010, etc.

Then when this individual worked performed on project completes, I want it to use the same date entered in the prompt to retrieve this same individual and print by date his time charge off for that date range. I get the main report correct. The link retrieves the individual but prints all this information since coming to work. When I tried to use the date from and to that I have passed, I can get it to work. I have tried on each of the fields at details. (I am printing at group summary)

I want this subreport to print what the individual charged to all projects on each date that is within the range of the filter of the main report.

shared_datefrom and shared_dateto are string variables.
How do I convert it back to date? Or date to string variable? Or will this not work?

The comparsion date in the table is a date. I get data type do not match. I have tried cdate(shared_datefrom) on the
if {te_transaction.billdate} >= cdate(shared_datefrom)and
{te_transaction.billdate} <= cdate(shared_datefrom) then ...


Any suggestions would be appreciated.

 
Can you clarify whether in the main report you are using a date parameter with range values allowed? I am unclear whether the main report date field is a string or a date or a string converted to a date just to pass to the subreport.

You still can link based on the range values by using a formula if it is a daterange parameter, e.g.,

//{@minparm}:
minimum({?daterange})

Repeat for maximum. Then add these two formulas as linking fields (without associated fields) and go into the subreport record selection formula and set up the sub date like this:

{table.date} >= {?Pm-@minparm} and
{table.date} <= {?Pm-@maxparm}

-LB
 
The prompt is a date put into a dimension value to be a string field. Example of the date would be datefrom 04/01/2001 and dateto would be 04/07/2010.

I will try the above and get back to you. If I get this to work, it is a much better solution than I was trying.



Thank you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top