Sep 12, 2007 #1 zemp Programmer Joined Jan 27, 2002 Messages 3,301 Location CA CR XI I have a report in which I have a formula to increment a shared variable in the GH1. GH1 is set to repeat on each page. I would like my formula to ecexute only when GH1 changes and not every time GH1 prints. Is there a way to achieve this? zemp
CR XI I have a report in which I have a formula to increment a shared variable in the GH1. GH1 is set to repeat on each page. I would like my formula to ecexute only when GH1 changes and not every time GH1 prints. Is there a way to achieve this? zemp
Sep 12, 2007 1 #2 synapsevampire Programmer Joined Mar 23, 2002 Messages 20,180 Location US Try: whileprintingrecords; numbervar MyNumber; If previous({table.groupedbyfield}) <> {table.groupedbyfield} then MyNumber:=MyNumber+1; MyNumber -k Upvote 0 Downvote
Try: whileprintingrecords; numbervar MyNumber; If previous({table.groupedbyfield}) <> {table.groupedbyfield} then MyNumber:=MyNumber+1; MyNumber -k
Sep 12, 2007 1 #3 lbass Technical User Joined Feb 9, 2002 Messages 32,818 Location US Or you could use the function: inrepeatedgroupheader, as in: whileprintingrecords; numbervar MyNumber; If not inrepeatedgroupheader then MyNumber:=MyNumber+1; MyNumber -LB Upvote 0 Downvote
Or you could use the function: inrepeatedgroupheader, as in: whileprintingrecords; numbervar MyNumber; If not inrepeatedgroupheader then MyNumber:=MyNumber+1; MyNumber -LB
Sep 12, 2007 1 #4 IdoMillet Instructor Joined Feb 6, 2001 Messages 5,290 Location US Crystal provides a nice special expression for this (InRepeatedGroupHeader). Using this expression, here's an alternative approach: Code: whileprintingrecords; shared numbervar MyNumber; If Not InRepeatedGroupHeader then MyNumber:=MyNumber+1; MyNumber - Ido view, e-mail, export, burst, distribute, and schedule Crystal Reports. http://www.MilletSoftware.com Upvote 0 Downvote
Crystal provides a nice special expression for this (InRepeatedGroupHeader). Using this expression, here's an alternative approach: Code: whileprintingrecords; shared numbervar MyNumber; If Not InRepeatedGroupHeader then MyNumber:=MyNumber+1; MyNumber - Ido view, e-mail, export, burst, distribute, and schedule Crystal Reports. http://www.MilletSoftware.com
Sep 12, 2007 #5 lbass Technical User Joined Feb 9, 2002 Messages 32,818 Location US Oops, yes, that should be "shared numbervar". -LB Upvote 0 Downvote
Sep 12, 2007 Thread starter #6 zemp Programmer Joined Jan 27, 2002 Messages 3,301 Location CA Thanks again, that did the trick. zemp Upvote 0 Downvote