Home » Developer & Programmer » Reports & Discoverer » sequence in report runtime
sequence in report runtime [message #202153] Wed, 08 November 2006 07:15 Go to next message
tsilav
Messages: 22
Registered: September 2004
Junior Member
i have a report that i want attribute a sequential numero every time user prints it, what can i do? My solution is to select a sequnece.nextval, is it possible? How can i do it
Re: sequence in report runtime [message #202213 is a reply to message #202153] Wed, 08 November 2006 14:47 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a sequence in the database.

In Report Builder, create a user parameter (let's call it P_SEQ).

Write AFTER PARAMETER FORM function as
function AfterPForm return boolean is
begin
  select seq_test.nextval into :p_seq from dual;
  return (TRUE);
end;


In Paper Layout, put the parameter value somewhere on the page (the simplest way would be using '&P_SEQ' syntax).

That's it.

However: as sequences do NOT guarantee increment by 1 (which is what you rely on, I believe) (because of caching issues), sequence number doesn't necessarily have to mean that its value will represent correct number of report runs.

Perhaps you should create some kind of a REPORT_RUN_LOG table and store report name and time stamp into it, and then simply COUNT number of records per particular report.
Re: sequence in report runtime [message #203151 is a reply to message #202153] Tue, 14 November 2006 02:05 Go to previous messageGo to next message
tsilav
Messages: 22
Registered: September 2004
Junior Member
thanks littlefoot, it's better
Re: sequence in report runtime [message #203242 is a reply to message #202213] Tue, 14 November 2006 07:46 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
hi,

If report executes where to write insert statment for report_log table?

It is not working if I write in afterParameter form?

Bye
Ashu
Re: sequence in report runtime [message #203245 is a reply to message #203242] Tue, 14 November 2006 07:57 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you COMMIT?
Re: sequence in report runtime [message #203249 is a reply to message #203245] Tue, 14 November 2006 08:22 Go to previous message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
Dear Littlefoot,

It slips from my mind.solved.

Bye
Ashu
Previous Topic: Problems to get a Discoverer sheet
Next Topic: Difference between Reports6i and oracle 9i reports
Goto Forum:
  


Current Time: Tue Jul 02 15:49:21 CDT 2024