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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying records from detail section in reprot footer separately 1

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
I have Order_Detail field placed in the detail section and the resultant is 2 records, always.

Detail: Order_Details: 100
200
----------------------------------------------
Footer: Formula 1: 100 Formula 2: 200

I need to display 1 record in formula-1 (100) and 2nd record in formula-2 in the report footer (as shown).
Please suggest how I could accheive this. Thanks
 
What distinguishes the two records? Does each record always have the same unique code?

-LB
 
Yes, it always generates 2 records only and it is generated from the SP. The SP generates only 1 column with 2 records.
 
Please help me, I know I need to use variable in header, detail and footer and then reset in header... But I am not clear how to reset it. Please suggest.
 
What is unique about each record? Does the first record always have the same code and the second record has the same different code? I'm trying to tell whether you can hardcode a conditional formula like this:

if {table.field} = "A" then {table.amt}

Then you could write two formulas like this and just insert a maximum for the report footer. Without knowing that, you could also write a formula like this for the detail section:

whileprintingrecords;
numbervar first;
numbervar last;
if onfirstrecord then
first := {table.field} else
if onlastrecord then
last := {table.field};

Then in the report footer, you can display these with separate formulas:

//{@displfirst}:
whileprintingrecords;
numbervar first;

//{@displlast}:
whileprintingrecords;
numbervar last;

-LB
 
Just saw your last post. If you are displaying the result in the report footer, why do you think you need a reset formula?

-LB
 

The procedure returns 2 records after sorting. Hence I need to now display these values separately in 2 formula. I thought we might need to reset the formula, but I know I was wrong.
 
Did you try to use a subreport in footer to display these records?
 
Well, are you all set with my last suggestion?

-LB
 
Sorry Ibass could not reply to your suggestion. You suggestion was good and was working, but if the value is NULL then it is displaying the value as 0. So, How could I display Null as Null and not as 0?

I used the formula as this;

Detail:
whileprintingrecords;
shared numbervar first;
shared numbervar last;

if onfirstrecord then
first := {@Header} else
if onlastrecord then
last := {SP_Order_Detail.order_detail};

Header:
{SP_Order_Detail.order_detail};

Footer:
formula1-
whileprintingrecords;
shared numbervar first;

formula2-
whileprintingrecords;
shared numbervar last;

Thanks
 
I don't think they are null if they are displaying zero, but you could just format each formula to suppress if zero (format field->number->customize).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top