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!

change subreport query based on main report?

Status
Not open for further replies.

hecktic

Programmer
May 14, 2002
84
CA
Hi,

I have a (main) report that depends on the criteria chosen by a user (sql query changes according to the user's choices). Now i want to create a subreport to show the data from the main report as a graph.

Is there a way to change the subreport query? I'm able to link the main report with the subreport... but that only results in my graph showing data for one record only. If you don't link the subreport, then i get data for all records.

e.g. If i choose to view data for June... i want the graphical report to show only data for June also.

Is there a way to do this?

Thanks!

 
Hi

Are you sure that there are more than one record for the criteria you have chose?

Regards
Krishna Kumar
 
I'm not quite sure I understand what you are getting in the main report.... have you asked for only June in the first place? What are you linking from Main to Sub? Is it the date field?

A few more details and I can probably offer some advice...

Thadeus
 
Ok, my main report shows data. It could be for June or for the whole year, it all depends on what the user chooses.

That works just fine. What i'm trying to do it have a subreport with a graph that will show a count of the data from the main report. Be it for June or not, again depends on the main report which in turn depends on the user choices.

So far, when i add a sub report, it can either show ALL data or only data from one specific record (when i link it) from the main report.

Hope i'm being clearer :)
 
Hi

Go to the subreport and place the fields in the detail section. Edit record selection formula for the subreport( for example subreport.table. field=June). Preview the report to see how many records are coming?

Regards
Krishna Kumar
 
If you join (link) by the date range, the subreport will be limited to whatever is in the main report, which means that its query is changing.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top