Click to See Complete Forum and Search --> : Urgent - Crystal Reports- How to find whether a record exists or not on a page????


deebsj
July 29th, 2005, 01:10 AM
Hi All,
I have a report design as follows:

Page Header has columns headings
Details has the corresponding data.
Report Footer Sub report.

Now my problem is that I want to display the PH if the details flow into more than first page, since the sub report is in RF. Hence I want to somehow find if there are records on the page or not so that I can apply a suitable suppress formula. Is this possible or is there some other way by which I can achieve this.
Please help me out.
Thanks in advance.

Madhi
July 29th, 2005, 10:44 AM
In the suppress event write this code

If NextIsNull(MainReportField) then true

deebsj
August 2nd, 2005, 03:02 AM
Hi Madhi,

I have tried that but it doesnt seem to work as per my requirement. Actually I want to know whether a record exists on a page or not? or whether the last page has any record or not?

Here is the exact scenario.
I have a page header having a table column headings, a details section having the data in tabular form(whose headings are on PH) and report footers a and b having a total filed and a sub report resp.
Now if the sub report is empty the RF is suppressed.
Now here are few cases that I need to take care of.
a. If the details section has all records on 1st page, suppress the RH(headings) in 2nd page. 2nd page is reached since there is data in sub report(RF) which is displayed on 2nd page.
b. If details section flows into 2nd page, show PH.
c. All data on 1st page but total on 2nd page, in this case also show PH.

Hence on 2nd page I need to check whether records are there or not so that I can suppress or keep the PH.

I hope I have made my requirement clear. Hope to get some reply ASAP.

Bastet
August 2nd, 2005, 05:05 AM
Hi

I am very new to Crystal so my advice may not be worthy, however I hope it can be of some help

First of all I do not understand why you do not put the column headings in the report header instead of the page header and that way if the report goes onto two pages the colums will also go onto two pages

Secondly, why is the sub report in the RF, have you tried adding another section below the details section (so that you have two details a and b) and adding the sub report into there, the sub report will then appear after all of the details from the 'details a' regardless of how long it is

I hope this makes sense and is of some assistance

If it does not good luck in finding a solution I know how frustrating it can be

Bastet
August 2nd, 2005, 05:53 AM
Hi deebsj

I have just looked at your second post and now realise that my advice is actually of no help, sorry