Print Page | Close Window

When top report Null Data, subreport skipped

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2945
Printed Date: 27 Apr 2024 at 11:32am


Topic: When top report Null Data, subreport skipped
Posted By: IrvineCAGuy
Subject: When top report Null Data, subreport skipped
Date Posted: 16 Apr 2008 at 4:46pm
I have a report that takes two dataviews generated prior to calling the report generator.  The first report or top report reads the inventory contained in boxes.  The second sub-report reads inventory that are loose items.  If there is data in each dataview, the reports run perfectly.  If the first or top report has no data, then the second report does not run either.  Is there a way to do a conditional test on the first database, and just jump to the sub-report.  Parameters are passed to the sub-report from the first as well (sub totals, weights, etc.)
 
 



Replies:
Posted By: hilfy
Date Posted: 18 Apr 2008 at 1:41pm
What type of section is the subreport in?  (Group footer, report footer, etc.)
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: AliL
Date Posted: 24 Apr 2008 at 1:50am
I have the same problem and it is driving me nuts. My master report has data in the details section and 3 subreports in footers b,c, and d. If there is no data returned in the master, then the sub report in fooret d does not run.  Sometime the sub in footer c also fails but I cannot see any patters for this yet.
 
The subreport in footer d used a different data set and the only information passed from the master is a running total.
 
 
I have tried linking data fields to no avail.
 
 
HELP!!!!


Posted By: hilfy
Date Posted: 24 Apr 2008 at 6:43am
They're not showing up because the group footers are not processed when the data is null and, if you're linking on data fields, there's nothing to link on when the data is null.
 
You might be able to change your group to be on a formula instead of a field.  The formula would look like this:
 
If IsNull({group field}) then
  SomeDefaultValue
else
  {group field}
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: AliL
Date Posted: 24 Apr 2008 at 7:13am

I thought it might be something like this, but I link on a group field which is a parameter and a shared formula field. The master report does return zero records but in theory the group field should still contain the parameter data and the shared formula should contain zero....i think.

 
I have tried using hte following formula in the shared formula of the sub report with no success:
 
If isNULL( mailto:%7b@Shared_Error_Total - {@Shared_Error_Total }) then
0 else
mailto:%7b@Shared_Error_Total - {@Shared_Error_Total }
 
Thanks for the response by the way.
 
I am thinking that maybe I don't need to link the report, just pass the required info via shared fields....Does this make sense?? You may have realised that I do not have a great deal of Crystal experience. I am self taught on Crystal and have reached the limit of my current ability.
 
The best was to learn I alwas think Smile


Posted By: IrvineCAGuy
Date Posted: 24 Apr 2008 at 8:25am
I am going to try another approach - I am making each sub-report a stand-alone report.  Then in the launcher, where I build the dataviews that are used by the reports, I will test the database for null dataset.  If the first report is null, then I'll open the sub-report directly as the main report.  It's cludgy but...it should work.  Not really a solution to the problem, but a work-around(?)



Print Page | Close Window