I am not sure if I am doing something wrong to be honest.
I have a simple Master - Detail type report. The report is displaying the correct data. However, when I run SQL Profiler to review the queries that are being executed, I see the master query run as expected. The detail query however has no filter on it.
I expected to see the parameter value from the master report being passed to the subreport so that it filters the query.
The result of this is a slow rendering of the report. It appears that for each record in the master report, it executes the sub reports query in an unfiltered state. My sub query could have 100,000+++ records. So it grabs that entire dataset, passes it back to the master report which then picks the correct record(s) that it wants. It then moves on to the next parent record.
Is that correct? I must be doing something wrong.
Think of it this way.I have customers table and invoices table. Each customer could have numerous invoices. I want a customer listing report that shows all the invoices for those customers. The sub-report query would be something like "Select Customer, Invoice from Invoice". I would have thought it would be something like "Select Customer, Invoice from Invoice where Customer= @Customer".
Please let me know what I have done wrong.