Print Page | Close Window

The same table twice in the same report

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6528
Printed Date: 15 May 2024 at 4:53am


Topic: The same table twice in the same report
Posted By: JuliaRomero
Subject: The same table twice in the same report
Date Posted: 01 Jun 2009 at 7:39am
Hi friends,

I have a report with the same table twice. One with the original name (Company) and the second with alias (Company_A). This report wants to show a "tree" of companies. With code I get a Dataset and I fill the report with it. This Dataset have two tables the original and the alias table with one and two rows expletively. The data is correct is what we expect that the report will show but this not occurs. He only see the rows of the original table and if you get more than one row in it he try a Cartesian product and we see invalid results. Can I fill the report with the correct rows to show in the report? Is there any other possibility? To help I put an example:

Fields of table Company as original table in the report: Company.

Fields of table Company as alias table (Company_A) in the report: Company and OriginCompany.

There is a relation between Company and Company_A through the field Company (original alias) and OriginCompany (alias table).

The dataset is like this:

Table Company: one row --> Company1.

Table Company_A: two rows --> Company1a, Company.

Company2a, Company.

Then the report only shows the rows of the original table Company but no trace of the alias table Company_A


If someone can help me thanks and if not also!!!



Replies:
Posted By: hilfy
Date Posted: 02 Jun 2009 at 8:49am

Are you linking from Company to Company_A or from Company_A to Company?  It should be from Company to Company_A.

Group by {Company.Company} and put that field in the group header.
Put {Company_A.Company} and {Company_A.OriginCompany} in the details section.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window