perove
asked on
Crystal Report counting record
I have a report in crystal report. It is a invoice report. It has a grouping on invoice number and a detail section where the "products" are listed.
Of different reasons I have to use a variabel MaxNuberOfLines and when I reach the correct number of lines I add a page break. When all the records for one Invoice is printed I print the invoice sum and print the giro that are in the page footer.
I been able to to all this (almost) having only one challange left.
Let say it is allowed to print execly 4 records per page. So if it is 6 records I will have 4 on page one and the two other on page two as well as the giro and the invioce sum.
This works OK but if it is 4 records on the invoce I gets the for record on one page and the sum/giro on the other. This is not want I want, I want it all on one page.
Here is the code for the detail_format I have
(Linje is norwegian for lineNr
Linje = Linje + 1 'counting the lines
If (Linje = MaxNuberOfLines ) Then 'reach the maxlines
Linje = 0 'put the counter back to 0
Me.Section3.NewPageAfter = True 'add a page break
Else
Me.Section3.NewPageAfter = False 'dont break page
End If
So the thing is that I dont want to put the pagebreak IF it is the last record in section even if MAXLINES has been reached.
anyone?
Of different reasons I have to use a variabel MaxNuberOfLines and when I reach the correct number of lines I add a page break. When all the records for one Invoice is printed I print the invoice sum and print the giro that are in the page footer.
I been able to to all this (almost) having only one challange left.
Let say it is allowed to print execly 4 records per page. So if it is 6 records I will have 4 on page one and the two other on page two as well as the giro and the invioce sum.
This works OK but if it is 4 records on the invoce I gets the for record on one page and the sum/giro on the other. This is not want I want, I want it all on one page.
Here is the code for the detail_format I have
(Linje is norwegian for lineNr
Linje = Linje + 1 'counting the lines
If (Linje = MaxNuberOfLines ) Then 'reach the maxlines
Linje = 0 'put the counter back to 0
Me.Section3.NewPageAfter = True 'add a page break
Else
Me.Section3.NewPageAfter = False 'dont break page
End If
So the thing is that I dont want to put the pagebreak IF it is the last record in section even if MAXLINES has been reached.
anyone?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If my second solution didn't make any sense, post the rest of you r code for this function and maybe I can figure it out then.
One other note, for your .RecordSelected to actually show the correct number, you must do a Me.Section3.RetrieveDataFi les command first, but it must be after your .RecordSelectionFormula property is set (if you have one).
ASKER
YES!!!
Just what I've been looking for!!
thanks
perove
Just what I've been looking for!!
thanks
perove