Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Subreport problem Post Reply Post New Topic
Author Message
maryammarz
Newbie
Newbie
Avatar

Joined: 17 Jan 2009
Location: Iran
Online Status: Offline
Posts: 18
Quote maryammarz Replybullet Topic: Subreport problem
     Posted: 26 Jan 2009 at 10:58pm

I have a subreport and I want to show all Messages at the end of each group.

here is my subreport:

Group header

Detail1

Detal2

Detail3

....
 
Group footer

Message1 + Message2 + Message3 + ....

 
 
any help would be appriciated.


Edited by maryammarz - 26 Jan 2009 at 11:52pm
IP IP Logged
catch_meow
Newbie
Newbie
Avatar

Joined: 26 Jan 2009
Location: Philippines
Online Status: Offline
Posts: 4
Quote catch_meow Replybullet Posted: 27 Jan 2009 at 3:45am
Hi, this might help u... try to put a shared variable in Subreport and Main report. You can then display the message in the main report and just concatenate the messages in one formula box.
In subreport formula:
   whileprintingrecords;
   Shared Stringvar x:= ToText(message1)
In main report formula:
   whileprintingrecords;
   Shared Stringvar x;
 
have 3 shared variable x,y,z then use concatenate formula to get them all together..
 
Have a good day!
-cat
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Jan 2009 at 6:46am
you would probably want the in subreport formulat to be:
Whileprintingrecords;
shared stringvar x := x + totext(message1)
 
don't forget to have a formula in main report that resets the message for the next group.  something like:
whileprintingrecords;
shared stringvar x := "";
 
hope this helps.
IP IP Logged
maryammarz
Newbie
Newbie
Avatar

Joined: 17 Jan 2009
Location: Iran
Online Status: Offline
Posts: 18
Quote maryammarz Replybullet Posted: 27 Jan 2009 at 9:31pm
Hi, thanx for ur reply
I do the same thing that u said.
 
but this time I got the last record of each group concatenated .
 
any idea?
 
thanks in advance.
maryam


Edited by maryammarz - 27 Jan 2009 at 9:35pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Jan 2009 at 6:37am
sounds like the formula is being applied in the group footer. The formula should be applied in (probably) the detail section.  If you don't want to see the string getting longer and longer, add a line after that just has "" on it.  The formula returns the last line to be visible.
 
Hope this helps
IP IP Logged
maryammarz
Newbie
Newbie
Avatar

Joined: 17 Jan 2009
Location: Iran
Online Status: Offline
Posts: 18
Quote maryammarz Replybullet Posted: 30 Jan 2009 at 11:01pm

Thank u lockwelle, It works!

just one thing. the last record repeats. how can I fix that?

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Feb 2009 at 6:04am
did you by chance leave the formula in the group footer?  that would cause it to duplicate.
IP IP Logged
maryammarz
Newbie
Newbie
Avatar

Joined: 17 Jan 2009
Location: Iran
Online Status: Offline
Posts: 18
Quote maryammarz Replybullet Posted: 03 Feb 2009 at 10:03pm
mmm... actualy yes.
because I want to show this at Group footer.Confused
 
I got it.Tongue I create another formula and put it in group footer with this code:
 
Whileprintingrecords;
shared stringvar x := x
 
It solve my problem.Clap


Edited by maryammarz - 03 Feb 2009 at 10:13pm
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