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!

Crystal Reports : multiple datasources and subreports

Status
Not open for further replies.

zephyrhex

IS-IT--Management
Jan 19, 2006
22
US
I have 2 subreports. Each subreports accesses a different datasource. the subreports list out products and totals for each product. the subreports run ok independently.

i have added the 2 subreports to my main report. i also added the 2 datasources to the main report, and linked each subreport to its datasource.

in the main report, i have created a combined/merged group. this group combines the products from subreport1 and the products in subreport2. the report appears to be reading records ok, but the display shows no products, and only lists out 1 total (there should be 1 total for each product...and there are 60,000+ products). the 1 total which shows is from the first product.

1) how do i get my combined group to display a list of products
2) how do i get the subtotals from the subreports to be associated with the list of products in the main report?

thanks
 
You can't use data from a subreport to create groups in the main report. Groups have to be based on some feature of individual records read in the main report.

If the main report has the same data sources used by the subreport, what do you need the subreports for? Why can't you define the groups on the basis of the two product fields that the main report is reading directly?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
thanks. this is the direction i am trying now.

Lets say i have the following:
source1:
apples 3
banana 4

source2:
apples 1
carrot 3

i want the report to show:
apples 4
bananas 4
carrot 3

i have tried to define my group as follows:
if source1.item = source2.item then itemNum := source1.item else ???

how do i define my group?
thanks
 
It would helpful to know what version of Crystal you have along with the database type and connectivity.

I use Crystal 11 accessing an Oracle DB using ODBC connectivity.

I had my DBA create a datase link to the other datasource.

I then use the Add command to union both tables together to satisfy my report needs.

-lw

 
crystal 8.5 ODBC to SQL DB

i have added the two databases to the report, and they are linked based on ItemNumber.

for my group definition, i have:
global stringVar itemNum;
itemNum := {IM5_TransactionDetail.ItemNumber} + {IM5_TransactionDetail_1QM3.ItemNumber};
itemNum;


that returns nothing. what is wrong with my group formula?
thanks
 
i have fixed the problem.

got rid of the subreports.

since my datbase tables were linked based on the product field, i was able to list out all products in all datasources by using the first product field in the line of links between tables. i used that first product field in the group declaration... and that allowed me to associate my subtotals with the products.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top