cancel
Showing results for 
Search instead for 
Did you mean: 

Sub report are showing data if main report dont have.

Former Member
0 Kudos

Hi All,

I have a report, where a sub report is present in detail section of main report. Main report and sub-report both have its own desire table to pulled data in report. I am facing one problem while fetching data which is mentioned below:-

Scenario 1 :-

> Let assume that 2 records are present in the table (main_table) which is associate with Main report let say for date(x_date) '04-02-2012' and '04-04-2012' .There is no record present for '04-03-2012'.

> Let assume that 3 records are present in the  table (sub_table) which is associate with Sub Report , Let say for date(x_date)  '04-02-2012' , '04-03-2012' and '04-04-2012' .

> Sub report is linked with Main report via (x_date) which is column in both the table. For link the sub-report we right click on sub report -> 'Change sub report Links' option .

Excepted result :-  Report should generate 3 page each page for date '04-02-2012', '04-03-2012' and '04-04-2012' .

Actual Result:- Report will generate only 2 page, for date '04-02-2012' and '04-04-2012'. NO records are coming for  '04-03-2012', since there is no record is present in main_table for '04-03-2012'.

Scenario 2:-

> Let assume that No records are present in the table (main_table) which is associate with Sub Report.

> But there is some records (let say 2 record for '04-02-2012' and '04-04-2012' ) are present in the table (sub_table) which is associate with Sub Report.

Expected Result :-  Report will generated with 2 page where data for main report is blank in both page but  records form sub-table will displayed at sub-report date wise.( record for '04-02-2012' in first and '04-02-2012' in 2nd page).

Actual result:- Sub report is not generating in crystal report 9 and a blank report will displayed in crystal report 2011. But data will not coming.

By above scenario I conclude that linking work on left join where Main report will left report with sub report. This is the reason why sub-report is not populating if records is not present in main reports.

Can anybody help me how I will display records from sub report even if we don’t have data in main report. How we link main report to sub report to achieve this?

Thank you in Advance.

Thanks,

Shanti

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shanti

You can outer join the (select distinct xdate from subreport table) first in the main report data pool?

If so, the main report can have all subreport xdate and have null xdate in main table

Hope it can help

cheer

Gary