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

Saving data from previous

Status
Not open for further replies.

byteias

Programmer
Apr 17, 2007
68
0
0
US
Using CR XI SP 3 with Oracle 9i.
When I get to print the 10th record I need to retrieve the values used by the 5th row.
How do I save it and reuse when I'm in my last row?
My report page print all 10 rows from a view, but I need to look back by using formulas and/or creating share number.
e.g.
whileprinting
numbervar saverow5;
if tbl.row_order=5 then saverow5=tbl.col8 of row 5
else 0
It's not working for mr and I get 0 all the time.
Any ideas of how to do it (I can get the value by using a function to read the view and return the desired column, but this is not the best solution)
Thanks,
Ivan.
 
Try a formula like this in the detail section.

whileprintingrecords;
numbervar cnt := cnt + 1;
numbervar row5;
if cnt = 5 then
row5 := {table.field};

Then you can reference the variable row5 later in the report.

-LB
 
Lbass, the question is:
CNT is used to count the records? What happen if record type doesn't exist?
Thanks,
Ivan.
 
I don't know what you mean. Can you be more specific?

-LB
 
The Row that I need to save has a rowtype = 5 and in this case it happens that it's the fifth row to be printed but what will it happen if one row is missing and the rowtype=5 becomes the 4th or 3rd row to be printed?.
Thanks,
Ivan.

 
That's a whole different question. If you just want to compare whatever row contains the rowtype = 5, then instead use a formula like this {@type5}:

if {table.rowtype} = 5 then
{table.field}

Then you can use the maximum of this formula in a later record to retrieve the value:

maximum({@type5})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top