Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

report within a report

Posted on 2013-01-03
12
Medium Priority
?
284 Views
Last Modified: 2013-01-04
Using CR 8 Developer

We have, for example:

Record 1
Record 2
Record 3
Record 4

Records 1 & 4 can be selected directly but 2 & 3 require a second select based on Record 1. Is this possible ?
0
Comment
Question by:cehrnow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
12 Comments
 

Author Comment

by:cehrnow
ID: 38741462
..or is it possible to run two separate select statements from the same table and merge the results into a single dataset ?
0
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 800 total points
ID: 38741737
Without knowing your data, a general response is it would be a lot easier if you could just write SQL to return the results you need, but your options with CR8 are extremely limited.  Why are you using such an old version?  Is it because you're support reports in a legacy application?

As to your second question, no you can't run two separate select statements, but you can add the table in twice and join it to itself.  Ex:  Add the "Customers" table, add it again and alias it as  "Customers2" and join Customers2 to Customers on the customer ID.

You might be able to get what you need from the second instance of the table if it's records are based on records from the first table.
0
 
LVL 23

Assisted Solution

by:Ido Millet
Ido Millet earned 600 total points
ID: 38742081
You can append two result sets (two SELECT statements using a UNION or UNION ALL statement. But your description is a bit vague, so I don't know what precise logic you are looking for.

You can also insert a linked subreport...
0
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

Author Comment

by:cehrnow
ID: 38742183
Apologies using CR 2008 v12 - Developer
0
 

Author Comment

by:cehrnow
ID: 38742253
Thanks rhinok - have tried this but still not sure it will work out. Best to reorganise db but this is not an option.

Thanks IdoMiller - given that there could be 100s of Record 1s with several Record 2&3 under each one do you still think a sub-report is realistic ?
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 38742520
Is this hierarchical data, such as an employee table where there are children (employees) and parents (supervisors)?
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 600 total points
ID: 38742582
Can you give a real example of how records 2 & 3 are related to record 1 or 4?
If so a linked subreport can certainly provide access and display of records 2 & 3.

With CR 2008 you can also use a Crystal command to select the records you need.  This command can be fairly complex.  You can also build a stored procedure or use temporary tables to create the desired recordset for the report.

mlmcc
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 38742609
Crystal Reports 8, not 2008.  The only SQL options are to use the Crystal SQL Designer (which I wouldn't recommend, since there won't be any support for it should an upgrade eventually be required) or to use Views/Stored Procs and stored proc support was extremely funky back then.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 38742628
Author's comment above

Apologies using CR 2008 v12 - Developer

mlmcc
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 38743456
Ahh, cool.  Missed that, thanks :)
0
 

Author Closing Comment

by:cehrnow
ID: 38743526
Thanks for all suggestions which I think covers options. However, it's such hard work even with these that I'm forcing through a db redesign.
0
 
LVL 18

Expert Comment

by:vasto
ID: 38744552
It is not necessary to redesign the database. This is a classic tree structure and can be easily handled by recursive queries. What is your database type ?
0

Featured Post

[Webinar] Protection from Cyberattacks

In this session, we’ll dive into the complexities of modern cyber threats and why only multi-vector protection can keep today’s businesses secure through the various stages of a cyberattack, across multiple vectors. Thursday September 14, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question