Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line/Row Count

Status
Not open for further replies.

Ridyen

Programmer
Jun 9, 2005
95
US
Simple Question. I am using CR Developer 10 or XI. Is there a row/line count available? I know there is a recordnumber but I'm looking for a "line count" on a page to utilize in a formula to force a group to a new page.



 
You can create a line count by using two formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

//{@linecnt} to be placed in the group header/detail
///footer sections that are displayed:
whileprintingrecords;
numbervar linecnt := linecnt + 1;

-LB
 
An alternative is a running total.

Right-click on a field and choose Insert to get a choice of Running Total or Summary. Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say. They default to 'Grand Total', but also can be for a group.

A summary count would give you the total number of detail lines in the group, available for the entier group. A running total count would give you the number of detail lines that have been printed so far.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top