Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Stop details sections from alternating Post Reply Post New Topic
Author Message
Hviezdoslav
Newbie
Newbie


Joined: 19 Jul 2010
Location: United States
Online Status: Offline
Posts: 9
Quote Hviezdoslav Replybullet Topic: Stop details sections from alternating
    Posted: 19 Jul 2010 at 5:27am
Please bear with me because I am very new to Crystal Reports.  I am using version XI.

I have a report that has two Excel files as data sources.  I have suppressed everything in design view except Details A and Details B.  On Details A, I have  the 3 fields from the first Excel file.  On Details B, I have the two fields from the second Excel file.  I only have two records in each Excel file and these two Excel files have nothing to do with one another.

In Section Expert, I have nothing checked for the Details, but I have Keep Together and Free-Form Placement checked for Details A and Details B. 

When I preview the report, I see a record for Details A, then a record for Details B, then a record for Details A, et cetera.  The report shows the 1st record of Details A, then the first record of Details B, then the first record of Details A, then the second record of Details B, then the second record of Details A, then the first record of Details B, then the second record of Details B, then the second record of Details B.

Does anybody know how I can keep Details A together to show its two records and then keep Details B together to show its two records?  I want each of the two details sections to be separate from one another and to not alternate.

In Report/Group Expert, I have nothing.  I am not trying to Group By.

I apologize for my ignorance and also if my questions does not make any sense.

Thanks very much in advance,

hviezdoslav

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 6:54am
sounds as if you did not join these two files at all. You need some way to let row one from file 1 attach to row 1 from file 2 (and only row one from file 2).
If the excel files do not have a connective field to join on can you add a counter to each one and join on that?


Edited by DBlank - 19 Jul 2010 at 6:56am
IP IP Logged
Hviezdoslav
Newbie
Newbie


Joined: 19 Jul 2010
Location: United States
Online Status: Offline
Posts: 9
Quote Hviezdoslav Replybullet Posted: 19 Jul 2010 at 9:16am
I thank you very much for the reply, DBlank.
 
Pretend in one Excel file that there are two records for authors, one with the value Dostoevsky and the other with the value Heller.  In the second Excel file, there are two records for cars, one with the value Toyota and the other with the value Lexus.  Details A has the field for the name of the author and Details B has the field for the make of car.
 
 
Before reading your post, I would get the following records when previewing the report and when I did not have the two Excel files connected:
 
Da Dostoevsky
Db Toyota
Da Dostoevsky
Db Lexus
Da Heller
Db Toyota
Da Heller
Db Lexus
 
I followed your suggestion and created a field named PK in each Excel file and I connected these fields of the Excel files with the default Inner Join.  This helped eliminate some of the records when I preview the report as now I see the following:
 
Da Dostoevsky
Db Toyota
Da Heller
Db Lexus
 
Is it possible for me to preview the report so that the data from the two Excel files shows in the following way?
 
Da Dostoevsky
Da Heller
Db Toyota
Db Lexus
 
Is it not possible in my case to preview the report with the two records from the one Authors Excel file showing in Details A and the two records from the Car Make Excel file showing in Details B? 
 
Of course I could do two separate Crystal Reports, one Crystal Report for each Excel file.  I just wondered if I could use one Crystal Report and show the records of the one Excel file together in Details A and show the records of the second Excel file together in Details B.
 
Again DBlank, I thank you much for your reply.
 
hviezdoslav
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 19 Jul 2010 at 9:21am

Because you can't join the tables, you're going to have to use a subreport for the data in one of the two files.  Here's what I recommend:

1.  Remove the second details section and take the second file out of your report.
2.  Create a subreport and insert it in the Report Footer.  The subreport will have the second file as its data source.  There will be no links to the main report.
3.  In the subreport, suppress all sections except the details.  Make the details section look like the details section you deleted from the main report.
 
-Dell
IP IP Logged
Hviezdoslav
Newbie
Newbie


Joined: 19 Jul 2010
Location: United States
Online Status: Offline
Posts: 9
Quote Hviezdoslav Replybullet Posted: 19 Jul 2010 at 9:33am
I thank you very much, Dell!

I did what you suggested and your suggestion worked.  Now I know that when I have two Excel files that are not related in any way and that each have only a few records of data, I can use a sub report as you suggested so that in one Crystal Report I can show separately in the report the contents of each of the two unrelated Excel files.

Thanks again very much.

hviezdoslav
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.