Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Main report not able to view fields of sub-report Post Reply Post New Topic
Author Message
Jelly
Newbie
Newbie
Avatar

Joined: 13 Jan 2008
Location: Australia
Online Status: Offline
Posts: 6
Quote Jelly Replybullet Topic: Main report not able to view fields of sub-report
     Posted: 15 Jan 2008 at 6:25pm
Hi,
 
In pre-viewing the report I was able to see my text object field and a '0' (zero) printing for for the MarketValue field . Strangely, when I tried to pre-view the main report, this MarketValue field was suppressed and but the text object field shows up. I tried a few more test and found that if there is a number other than 0 then the field shows itself. I have checked the fields format and the "suppress if zero" is unchecked.
 
subreport  preview                main report preview
(eg 1)
------------------------                -------------------------------------
MarketValue       0                  Market Value                     
------------------------                -------------------------------------
 
(eg 2)
------------------------                -------------------------------------
MarketValue     234                Market Value           234             
------------------------                -------------------------------------
 
My assumption is if you can see it in the preview, it will show up so I'm not sure why the main report is suppressing the zero.
 
Is there a configuration in the main report that can suppress certain fields in the subreport?
 
Thanks,
 
Jelly
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 15 Jan 2008 at 10:23pm

Jelly

Is there any link between main report and sub report ?. if yes and  if there is no record in the sub report  linked to the main report then the record or value is not displayed. please check and get back 
Thanks
Savan
IP IP Logged
Jelly
Newbie
Newbie
Avatar

Joined: 13 Jan 2008
Location: Australia
Online Status: Offline
Posts: 6
Quote Jelly Replybullet Posted: 16 Jan 2008 at 5:03pm
Hi Savan,
 
The link between the reports were fine, but you were right, there was no record therefore the result was not displaying. I have tried to use
 if(isnull(field)) then
    formula = 0
 else
    formula = sum(field)
 end if
 
Assuming that it will be 0 if there is no result, but it doesn't seem to work because its still showing blank. Is there another way to find out if the SP returns no records?
 
I have ordered the book but its taking its time on the roads. :)
 
Thanks, 
Jelly
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 16 Jan 2008 at 9:16pm
Jelly
 
 there is one way to get the record on the main report if there are no records in subreport.
the only thing u have to do is add one more table on the main report which u want to link with the table in the subreport.
now you link both the table in main report.
and link the second table (alias table) with the table in subreport.
in the main report you put the alias table field which is linking with  the sub report  table and supress it.
in this way u will get all the records from the table in the main report.
 
please try out this and let me know if you have still the problem. i will suggest u another way too :)
 
Thanks
Savan
IP IP Logged
Jelly
Newbie
Newbie
Avatar

Joined: 13 Jan 2008
Location: Australia
Online Status: Offline
Posts: 6
Quote Jelly Replybullet Posted: 17 Jan 2008 at 3:38pm

Savan,

Is there a simpler way of finding out if a Store Procedure is returning a record?
 
It would be easier if I was able to control the backend of the report, but because a third party is supporting this, I would just need to check if the SP is returning any record in the front end.  
 
Thanks,
Jelly
IP IP Logged
Sladiebug
Newbie
Newbie
Avatar

Joined: 20 Jan 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Sladiebug Replybullet Posted: 20 Jan 2008 at 8:44am
Did you ever resolve this? One thing to check is under the File menu, report options. Check to make sure that the convert database null values to default is checked. Also the one below it too. Convert other null values to default. 
IP IP Logged
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