Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sub Report and Main Report Post Reply Post New Topic
Author Message
suresh.gooty
Newbie
Newbie
Avatar

Joined: 14 Jan 2010
Location: India
Online Status: Offline
Posts: 6
Quote suresh.gooty Replybullet Topic: Sub Report and Main Report
     Posted: 09 Feb 2010 at 11:33pm
Hi All,

I want to use my sub report as main report and i want to display only subreport.... i dont want any details of main report in report..... because i am getting my desired data in subreport.............Also i want to increase the width of the subreport and main report should be less in width....... is there any option to get the data into main report........ from sub report...... .....
Thanks & Regards,
Suresh Gooty
Sr Software Programmer
Crystal Reports XI & BO
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Feb 2010 at 8:26am

don't code any fields in the main report, suppress the bands / fields that you use to link the subreport to the main report.  You can't make the subreport bigger than the main report in width...it's a subreport. 

what data do you want from the subreport in the main report?  if it is not too much you can use shared variables.
 
why are you using a subreport, sounds like you should make the subreport the main report....subreport degrade the performance of a report as there are more round trips to the database...1 per call of the subreport.
 
HTH
IP IP Logged
suresh.gooty
Newbie
Newbie
Avatar

Joined: 14 Jan 2010
Location: India
Online Status: Offline
Posts: 6
Quote suresh.gooty Replybullet Posted: 10 Feb 2010 at 7:51pm
Hi lockwelle,
 
Thanks a lot for your shared variable idea.... can you explain what are the steps i need to take to create a shared variable ..... i never used this shared variable.......
Thanks & Regards,
Suresh Gooty
Sr Software Programmer
Crystal Reports XI & BO
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Feb 2010 at 6:39am
shared variables are easy....
in a formula,
shared xxxxxvar variableName;  //look at the types of variables that CR supports, but they all end var
 
then you can use it in the formula.  If you want to access it in another formula, just include the header information.
 
Biggest caveat,  := is assignment, = test for equality
 
usually there are 3 related formulas, but there could be more or less.
1 to reset the variable to 0
1 to increment th variable
1 to display the variable
 
it may be that you never need to reset the variable, so that would be less.  you might be tracking more than 1 variable in a formula, so that woud be more (usually in the display)
 
HTH
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