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

DIsplaying Records from Subreport when Main Report has no records

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR 2008 and Oracle 10g db as my data source. I'm trying to create a report that lists all marketed and nonmarketed applications for a country/product family. There are countries that have both marketed and non-marketed applications, some with one or the other but not both. My main report has non-marketed applications and the subreport has marketed applications. I've linked them by country and by product family. My problem arise when the subreport contains countries that are not in the main report. The main report does not reurn data from the subreport unless there is a non-marketed application for that country. How do I get subreport information to appear in my report if thereis no corresponding country information in the main report?? I cannot combine both marketed and non marketed applications in the same report because they are unrelated, other than by country and drug product.
 
Subreports behave as if they are left-joined to a main report, so you cannot get information in the sub if there is no info in the linking field in the main report.

You might be better off using a command (database expert->your datasource->add command), if you are using the same datasource to access both. You could set it up like this:

select 'Marketed' as type, table1.application, table1.country, table1.product
from table1
where <your criteria here>

union all

select 'Non-Marketed' as type, table2.application, table2.country, table2.product
from table2
where <your criteria here>

This would merge fields in the same ordinal position into one field. You could distinguish them by using {command.type}. You could insert a crosstab, using type as a column field, for example.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top