filtering subreports based on main report fields 
Author Message
 filtering subreports based on main report fields

I have a subreport that has pages and pages of data.  The subreport was
placed in the sub_id footer section of the main report.  I have an
invisible field called primary_id displayed in this footer for the main
report.  I would like to filter the subreport to only show records where
the subreports field also called primary_id is equal to the current
value of the primary_id from the main report.

I tried setting the filter on the subreport to:
[primary_id] = reports![rolled_new]![primary_id]

But when I do this the subreport just shows up as blank.  The first
record of the main report has an primary_id of 19.  If I hardcode the
filter to say [primary_id] = 19.  Then when I run the main report I see
five records in the subreport.

I hope it is clear what I am trying to do.  Does anyone know a good way
to do this?

Thanks for your help.



Mon, 24 May 2004 08:39:59 GMT  
 filtering subreports based on main report fields
You have to link the sub report to the main report.
on the data properties of you subreport (while you are on the main report)
make sure you pick the link.childfields and link.master fields to the
mrimary key on your main report and the one on your subreport. Once you do
this, you will only get the records on your subreport related to the record
of your main report.

Rodrigo.


Quote:
> I have a subreport that has pages and pages of data.  The subreport was
> placed in the sub_id footer section of the main report.  I have an
> invisible field called primary_id displayed in this footer for the main
> report.  I would like to filter the subreport to only show records where
> the subreports field also called primary_id is equal to the current
> value of the primary_id from the main report.

> I tried setting the filter on the subreport to:
> [primary_id] = reports![rolled_new]![primary_id]

> But when I do this the subreport just shows up as blank.  The first
> record of the main report has an primary_id of 19.  If I hardcode the
> filter to say [primary_id] = 19.  Then when I run the main report I see
> five records in the subreport.

> I hope it is clear what I am trying to do.  Does anyone know a good way
> to do this?

> Thanks for your help.



Mon, 24 May 2004 09:39:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Accessing Subreport field from main report in Crystal

2. Displaying Subreport Totals Fields in Main Report

3. Make Link subreport with main report using fields (using API)

4. displaying field from subreport in main report?

5. Pass value field subreport to main report

6. Referencing Fields in main report to subreport

7. Accessing fields in subreports from Main report

8. main report with subreport in columns

9. Summaries of SubReports in the main report

10. Get subreport's summary from main report

11. add subreport(s) to main report

12. Subreport does not show when main report is blank

 

 
Powered by phpBB® Forum Software