Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: two sql queries one report Post Reply Post New Topic
Author Message
tcmccann1
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tcmccann1 Replybullet Topic: two sql queries one report
     Posted: 08 Apr 2009 at 3:31am
I am pretty new to this but was wondering can i have two different sql queries that return different results and feilds but have the results on one report?

Edited by tcmccann1 - 08 Apr 2009 at 3:37am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2009 at 6:44am
Are you planning on joining these or not?
IP IP Logged
tcmccann1
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tcmccann1 Replybullet Posted: 08 Apr 2009 at 6:54am
no they wont join
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2009 at 6:57am
technically you can do this but you may want to create a sub report for one of them instead.
Use one query in the main report to display what you want and a the other in the sub report to display what you want without linking there.
Adding 2 unlinked tables or queries can cause some issues and you will allways get a prompt indicating this.
IP IP Logged
tcmccann1
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tcmccann1 Replybullet Posted: 08 Apr 2009 at 7:04am
I have done the sub report which kind of works but god i can not get the layout right. I have the following

report header
page header
details a first query
details b (sub report)
report footer
page footer

the problem is the first query is being broken up line by line by the insertion of the sub report
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2009 at 7:12am
Don't use the detail section.
Place it on a header or footer.
When a sub report is on a detail it will rerun it for every instance that it has a row in the details.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2009 at 7:15am

Use the Report header or Report Footer, not the page header or page footer or it repeats for each page.

You can also add an extra header or footer secion if needed (RHb/RFb)
IP IP Logged
tcmccann1
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tcmccann1 Replybullet Posted: 08 Apr 2009 at 7:22am
that works now thank you so much.
IP IP Logged
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