• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1105
  • Last Modified:

Selecting conditional subreports in the main report

I am using Crystal reports 10 and crystal enterprise 10 .
Can anyone help me out in suggesting "How to select the conditional subreports in the main report ?".
I want to import subreports by using IF-THEN-ELSE condition in the main report.

Any help is appreciated.
Thanks in advance.

1 Solution
Ken TurnerCommented:
Have you thought of putting each subreport in a section on its own, and then conditionally suppressing these sections?
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
There are only two-types of subreport:

1)  Linked - the subreports are linked to data in your main report and always run regardless of whether they are conditionally suppressed or not (* see workaround below)
2)  On Demand - the subreports don't run until an end-user clicks on them

*  A linked subreport is basically treated like a correlated subquery.  A subreport is a query in it's own right, but you pass in filters from the primary report to the subreport so that the data in the subreport is related to the data in the main report.  If you are using a SQL-based database (Oracle, SQL Server, etc...) then you might be able to use SQL Expression fields to stop reports from running in the first place (the only way I know of that allows you to prevent unwanted subreports from ever running Vs. running all subreports and just suppressing them[very inefficient]).

What type of if-then-else criteria do you actually want to use?

I don't believe Crystal can do what you want except by adding the reports at design time then as suggested above suppressing the ones you don't want.

It probably is possible through a custom application but not through Crystal coding.

ashishanandAuthor Commented:
Thanks for your help !!

As I understand that we cannot  conditionally include subreports into main report, i would probabely use section as an alternate to subreports to meet our requirement.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now