Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to insert a conditional subreport?

Status
Not open for further replies.
Jun 18, 2002
3
US
I need to insert a report if a certain field is reported on. For example if the field "audio-video" is in the report, I need a specific subreport to display.

So basically I am going to be making many subreports for each type of field that might display and attach a unique subreport to each one to display when it appears in the main report.

Is there a way to make the subreport itself conditional?

Or Is there a way to have an "if then else" formula display a report instead of just text??

Please Help!!!
 
You can insert subreports into separate sections and have those sections conditionally suppressed. Right click the section and use insert section below, then right click the new section and select Format Section then click the X-2 next to the Suppress (no drill down). You can now use something like:

isnull({MyTable.Audio-Video})
or
{MyTable.Audio-Video} = ""

-k kai@informeddatadecisions.com
 
The problem I have been having is that I am using the reports in an applicatio called "D-Tools" which uses an Access database. It seems that when ever i insert a subreport, the report flashes on the screen and disappears when I try to view the report in D-Tools. They work when previewing in Crystal, but when I transfer the file to D-Tools and run the report it breaks.

When I use this conditional suppression the report works if the subreport is suppressed, but when the condition is met and it is supposed to display the subreport it breaks.

I haven't been able to find anything about this problem anywhere.

Ryan
 
The only time that I have seen this happen is when the subreport was in the report header and it was over one page in length. An "on demand" subreport opens in a separate tab so you shouldn't have that problem. Remember, on demand is not the same as conditionally suppressed.

Lisa
 
It could be that Dtools passes connection info to the report, but isn't designed to pass connection info to a subreport.
This is a question for D-tools. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top