Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Use a formula as a group Post Reply Post New Topic
Author Message
MickMick72
Newbie
Newbie


Joined: 30 May 2011
Online Status: Offline
Posts: 3
Quote MickMick72 Replybullet Topic: Use a formula as a group
     Posted: 21 Jun 2011 at 9:20pm
Hello everyone,

I tried to use a formula as a Group but I cannot use it in the Group Expert.

So basically for each document (for each page i want to display in the report) we have one or more TARIC NumbeR (to be simple we can compare that to one or more items in one invoice) . See below a brief part of the requirements about my problem.

If we have more than 1 TARIC to list, we will add more than one page In the added pages, the areas 31 and 44 are repeated 3 times per added page

Thus if we have :
• 1 TARIC, it will be displayed on the first page « Sheet A »
• 2-4 TARIC, TARIC 1 on main page « sheet A » and the others on the added page
• 5-7 TARIC ; TARIC 1 on main page, TARICs 2-4 on added page 2 and TARICs 5-7 on added page 3
• And so on



Here's how the structure of the data in my report

Document number----DepotNumber----Order Number -----TARICNumber
456425245224...............1234..................... 30 .................... 1000
456425245224...............1234..................... 30 .....................4545
456425245224...............1234..................... 30 .....................7853
456425245224 ..............1234..................... 30 .....................5456
456425245224.............. 1234..................... 30 .....................5454

817655421425.............. 1234..................... 40..................... 3999
817655421425.............. 1234..................... 40..................... 0545
817655421425.............. 1234..................... 40..................... 3218
817655421425.............. 1234..................... 40..................... 7245

654034141354.............. 1234 .....................65..................... 8031

The data are grouped on DepotNumber and Order Number . One document can be identified with these 2 Numbers.

Well, here's the result of what i did to get the grouping
Doc----Depotr----Order -----TARIC
456425245224........1234............. 30 ............. 1000.....1.......break1
456425245224........1234............. 30 ...............4545.....2......break2
45642524522..........1234............. 30 ..............7853.....3.......break2
456425245224 .......1234............. 30 ...............5456.....4......break2
456425245224....... 1234............. 30 ...............5454.....5......break3

817655421425....... 1234............. 40.............. 3999.....1.......break1
817655421425....... 1234............. 40.............. 0545.....2.......break2
817655421425....... 1234............. 40.............. 3218.....3.......break2
817655421425....... 1234............. 40.............. 7245.....4.......break2

654034141354....... 1234 .............65............. 8031.....1.......break1


First I insert a RunningCount

//Reset of RunningCount
whileprintingrecords;
numbervar CountTest;

if not inrepeatedgroupheader then
RunningCount := 0;


//RunningCount in the detail section
whileprintingrecords;
numbervar RunningCount ;

RunningCount := RunningCount + 1



Then i create a function like
if RunningCount = 1 then break 1
if RunningCount = 2 then break 2
if RunningCount = 3 then break 2
if RunningCount = 4 then break 2
if RunningCount = 5 then break 3


THE PROBLEM is that i can't use this funtion to group the data....
Any suggestion ?


Thanks a lot
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 22 Jun 2011 at 3:16am
you cant use evaluation formulas to group by or selection criteria.
what are you actually trying to accomplish,
page breaking on change of????
grouping issue????
sharona
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