Data Connectivity
 Crystal Reports Forum : Crystal Reports .NET 2003 : Data Connectivity
Message Icon Topic: When top report Null Data, subreport skipped Post Reply Post New Topic
Author Message
IrvineCAGuy
Newbie
Newbie


Joined: 16 Apr 2008
Location: United States
Online Status: Offline
Posts: 2
Quote IrvineCAGuy Replybullet Topic: When top report Null Data, subreport skipped
    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.)
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 18 Apr 2008 at 1:41pm
What type of section is the subreport in?  (Group footer, report footer, etc.)
 
-Dell
IP IP Logged
AliL
Newbie
Newbie
Avatar

Joined: 24 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote AliL Replybullet 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!!!!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
AliL
Newbie
Newbie
Avatar

Joined: 24 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote AliL Replybullet 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:
 
 
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


Edited by AliL - 24 Apr 2008 at 7:37am
IP IP Logged
IrvineCAGuy
Newbie
Newbie


Joined: 16 Apr 2008
Location: United States
Online Status: Offline
Posts: 2
Quote IrvineCAGuy Replybullet 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(?)
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.