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

Why Main report doesn't link to Subreport?

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
Hi to all experts,

I have a question regarding about subreport. this is my first time to use subreport

Crystal 8.5
Oracle Database

Problems:
I have created a subreport, however, a strange thing is i go to Edit/Subreport Link. i choose table1(main report) link it to table2 (subreport). The subreport works well, however, table1 doesn't seems to recognize the data in table2. What should i do to have table1 recognize table2? i have included the data below to clarify what i want to ask.

table1 (main)
custno 1_partn
12343 aa12566
12343 aa12566
12343 aa12577
12399 aa12577
12399 aa12588

table 2 (sub)
lotb 2_partn
ns1234 aa12566
ns1280 aa12566
ns1234 aa12588
ns1200 aa12590
ns1377 aa12592

from my sql for main, i have:
select custno, 1_partn from table1

select lotb, 2_partn from table2

when i have main and subreport together AFTER i link the subreport to main, this is the outcome i got:

custno 1_partn lotb 2_partn

12343 aa12566 ns1234 aa12566
12343 aa12566 ns1280 aa12566

12343 aa12577 ns1234 aa12588
12399 aa12577

12399 aa12588

however, i only want to display IF 1_partn = 2_partn. i have color in red meaing that i don't want 1_partn aa12577 to be display, since i have already set 1_partn = 2_partn This is true for the subreport ONLY, but it is not true to the main.

Please help me on this as i really donno how to appoarch. I've try to do record selection formular, but can't do it becuase from main report, it doesn't recognize 2_table.

thanks million million for those who help..

best regards,
mm

 
Assuming you specified {1_partn}, it failed to match to {2_partn} because they are different field names.
Hence, {1_partn} became a parameter in your subreport that you must manually use in the record selection formula of the subreport (not the main report).

Edit the subreport, select Report, Record Selection Formula and enter the
{?Parm_1_partn} = {2_partn}
condition there.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Hi Ido,

Thank you for your reply.
I already have hte formula: {?Parm_1_partn} = {2_partn} in the record selection.

However, it seems like to me that the report pull out ALL the data from table1, but only
{?Parm_1_partn} = {2_partn} applies to table2. Meaning that table2 is distinctive, but not table1.

my question is how can i make 2 table (main and subreport) to be distinctive. I want to retrieve data where only Partn is equal to each other both on Main and Subreport.

please let me know .. this is very important to me. thanks to everyone who help.

m
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top