Home » Developer & Programmer » Reports & Discoverer » Serial Number Field
Serial Number Field [message #601653] Sat, 23 November 2013 14:28 Go to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
Hi,,
I need to have a repeating field in a report that gives me a serial number, that begins from 1 to ....
The numbering is depending in a column of my table. How can add such a field.
Example to make it clear,
Father Name :
Amjad
--------------------------------------------------------------------------------
Child Serial Number******** Child Name:
1************************** Hanan
2************************** Takrid
--------------------------------------------------------------------------------
This is the first page,
The second will be :


Father Name :
Ayman
--------------------------------------------------------------------------------
Child Serial Number******** Child Name:
1************************** Khalid
2************************** Said
3************************** Mohammed
--------------------------------------------------------------------------------
you can see the the child serial number is increasing and decreasing depending on the child's Name that is in the children table....

.............
Thanks
Re: Serial Number Field [message #601905 is a reply to message #601653] Wed, 27 November 2013 01:10 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How do you create a serial number? Is it a summary column? If so, set its "Reset at" property to appropriate group. If you calculate it yourself (how? ROW_NUMBER() might be a good choice), then fix its PARTITION BY clause.
Re: Serial Number Field [message #602301 is a reply to message #601905] Mon, 02 December 2013 22:09 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
if this is the Master detail scenerio then you have to compare the pk and fk after the in the form level.and it will be print on report autometically.
in Detail table use Key-Next-item (item level) or pre-insert(block level) trigger
select nvl(max(sno),0)+1 into :sno from tablename
where fk=:pk;
it will gives you exact answer on reports....

[Updated on: Mon, 02 December 2013 22:11]

Report message to a moderator

Re: Serial Number Field [message #602326 is a reply to message #602301] Tue, 03 December 2013 04:08 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not saying that your suggestion is wrong, shahzad-ul-hasan (I don't know what is correct as the OP didn't reply, yet).

However, as you mentioned Forms: note that as long as "MAX + 1" principle works in a single-user environment, it is about to fail in a multi-user environment, so - you'd rather avoid it. Sequences are a far better choice.
Re: Serial Number Field [message #602328 is a reply to message #602326] Tue, 03 December 2013 04:14 Go to previous messageGo to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
I did it using a summary field and I made it count.

Thanks all
Re: Serial Number Field [message #602331 is a reply to message #602326] Tue, 03 December 2013 04:22 Go to previous message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
thanks for understanding..
Previous Topic: Issue with binding parameter in Data wizard query
Next Topic: Getting Sum of Student gender wise...
Goto Forum:
  


Current Time: Thu Mar 28 18:55:36 CDT 2024