I think you will need to solve this at the data source end.
If you are using SQL statement in your report:
Unless you have some column in your database you can use to split the records in groups of ten I think you can solve this by adding a unique number to every 10 records and using this number to create a sub total in Crystal Report.
Use SQL
ROW_NUMBER[
^] to assign a unique number to each record.
Divide this number by 10 and use
CEILING[
^] to round the number up.
This should give the first 10 records number 1 and the next 10 records number 2, etc.
Now use this column to create the sub totals for every 10 records.
I have no time to test this, so I am not 100% sure it will work but give it a try.
I have tested it and it works, use the below statements.
Create and populate table:
CREATE TABLE Customer
(Name CHAR(8),
Sale INTEGER DEFAULT 0)
DECLARE @counter INTEGER
SET @counter = 1
WHILE @counter <= 100
BEGIN
INSERT INTO Customer VALUES ('CUST' + REPLICATE('0', 4-LEN(@counter)) + CONVERT(CHAR(4), @counter), ABS(CAST(CAST(NEWID() AS VARBINARY) AS INTEGER)) % 10000)
SET @counter = @counter + 1
END
Create groups of 10 based on the
Name
:
SELECT CEILING(ROW_NUMBER() OVER(ORDER BY Name)/10.0) AS GroupID, Name, Sale
FROM Customer
ORDER BY Name