Link to home
Start Free TrialLog in
Avatar of Jeff S
Jeff SFlag for United States of America

asked on

Help with a Crystal Report Formula

In my Stored Procedure, I have a field "TotalPagesPerClaim". Per my clients request, they would like to have the "EstimatedAmountDue" total printed on the last page only and not sub-total per page as it presently does.

Example, I have a claim with 30 procedures on it and the first 20 print on page 1 and the additional 10 print on page 2. Right now, the report is subtotaling the 20 procedures and putting a total on page 1 and on page 2 its taking the other 10 and using their subtotal and printing that total there. What my client desires is to look at the "TotalPagesPerClaim" field, find the maximum page number and put the cumulative total for all 30 on that last page and on the prior pages print a blank/null value. Hope this make sense.
Avatar of Mike McCracken
Mike McCracken

Does the value have to be in the page footer?

How about putting it in the group footer?
You can print the group footer at the bottom of the page.

Are you printing only one claim at a time?
IN that case just suppress with

Not OnLastRecord

mlmcc
Avatar of Jeff S

ASKER

mlmcc,

It is currently going to the Group Header 1 section. Its one claim per PatientVisitId. Basically one ticket per patient for that days services. Please see the attached claim form for illustration. I outlined the fields in question. This prints to a pre-fab form they send on to the insurance.

User generated image
Avatar of Jeff S

ASKER

mlmcc -

They could select multiple visits for other patients to all print at the same time. In that instance, I need this scenario to look at that visit and handle it distinct from the others and print on the last page for that visits services. Each patients would follow the same logic. Example we both saw the MD and both had 30 services rendered. On your claim, you would have 2 pages - on page one, it would be blank for the total and on page 2 it would take the sum of everything and put it in the estimated amount due field, My claim would do the same as yours and treated as two unique claims. hope that makes sense.
Do you have a total pages per claim field in the database or are you thinking it is available in the report?

Crystal doesn't know the last page until it prints it so on page one it doesn't know if this is the last page or not.

Will 20 records/procedures always fit on a page?
If so you can calculate the last page using

     Count({ProcedureField})

You can get the last page with

     Ceiling( Count({ProcedureField}) / 20)

Try using that to compare to the page number

mlmcc
Responded then saw the update.

You can get the count for a group by including the group field

   Count({ProcedureField}, {groupfield})

mlmcc
Avatar of Jeff S

ASKER

I used 20 as a round number, but its in fact 22 Procedures that will fit on one page.

With that being said, I get 22 procedure lines exactly in my output and the Stored Procedure re-executes when it hits procedure #23 and sets it up to procedure 1 for the subsequent page. Could I not use the "TotalPagesPerClaim" field that my stored Procedure already is using to give me that value and have it only pull that value on that page?
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeff S

ASKER

Appreciate your help