1
votes

I have a simple Select * from Table that i want to show on crystal report.
I want to have a summary of records on each page as well as in the report footer too. But when i follow these steps, i can't see any Page Footer in the drop down list of 'Summary Location'.

Right Click -> Insert -> Summary -> Summary Location. Only Report Footer is shown

Anyone have had a similiar problem ?

1
What sort of summary of records do you want - a count of records on the page? Something else?user359040

1 Answers

2
votes

(Updated) Unfortunately, you can't put summary items into page headers / footers in Crystal.

To get round this, you need to use Crystal variables inside Crystal formulas.

To set up running totals of columns on the page:

(1) Create a formula (called something like initiate) to set the totals to 0, with the following code:

WhilePrintingRecords;
global numberVar tot1;
global numberVar tot2;
tot1 := 0;
tot2 := 0

Include one variable for each column you wish to sum. Add this formula to your page header section, and set it to be suppressed.

(2) Create a formula (called something like iterate) to add column values to each total, similar to the following code:

WhilePrintingRecords;
global numbervar tot1;
global numbervar tot2;
tot1 := tot1+{table.Field1};
tot2 := tot2+{table.Field2}

Add this formula to your details section, and set it to be suppressed.

(3) Create a formula (called something like display1, display2, etc) for each total to display the total, similar to the following code:

WhilePrintingRecords;
global numbervar tot1;
tot1 := tot1+0

Add these formulas to your page footer section (not set to be suppressed).