0
votes

I am using a datatable to load the data for the crystal report. Based on the data filtered by the user in the DataGridview and clicking on Print will display the filtered data in Report.

All is fine.I have done this.When there is no data in the Details section I am suppressing it using the below formula in the suppress.

Shared NumberVar PageofLastField;

If OnLastRecord then PageofLastField = PageNumber;

In the header section when there is no data in Details section supress page header.Below is the formula used.

(Reference Crystal Reports - Suppress a Page Header if the page has 0 records)

Shared NumberVar PageofLastField;

PageofLastField := PageofLastField;

if pageofLastfield <> 0 and PageNumber > PageofLastField
  THEN TRUE
ELSE FALSE

Below is the image of the crystal report.enter image description here

When I click PRINT button in the front end. When there is no data in Details section the Page header is displayed.

Below image is the Second page of the report where there are no records and summary is displayed.

enter image description here

If in the header section if I use the below formula

OnLastRecord AND Count({PaymentReportTable.InvID}) <> 1

In the Second Page even if the records are displayed Pageheader is not displayed.I understand it becos the formula says it all.

enter image description here

I have created around 12 Crystal reports and I am facing the same problem in all of them.

Please advice.

1
I have also tried ...Pagenumber<>1 and IsNull({PaymentReportTable.InvID}). If on second page InvID is not null it is displaying the header.But when there is no data still the header is displayed.Prathap

1 Answers

0
votes

I read your question. just inform me what happen when you not suppress.

I think your footer evaluate because of it has the value.

are you try OnLastRecord or {GROUP FIELD NAME} <> Next({GROUP FIELD NAME}) this condition as your reference link.