[Solved] Autonumeric column in report

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
mariussiuram
Posts: 3
Joined: Fri Jul 04, 2008 10:29 am

[Solved] Autonumeric column in report

Post by mariussiuram »

Hi, I was trying to get a table-report from a query. The query is very simple (basically a list of names). I want to put them on a table.

The first column of the table should be autonumeric (1,2,3...) the second column the name of the person and the third column empty. I cannot achieve the autonumeric column (inserting fields doesn't work and I have done a bunch of tries without being successful).

(The table always start at number 1, 2, 3 ... and so on, the number is not a name's property)

Thanks for your help!
Last edited by mariussiuram on Sun Jul 06, 2008 10:40 pm, edited 1 time in total.
OOo 2.4.X on Ubuntu 8.x + Windows
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Autonumeric column in report

Post by TheGurkha »

If I understand your question correctly, then to achieve what you want you need to create your database, then create your three fields (plus however many other fields you are using).

Set the first field type to be BigInt and in the field properties at the bottom, set AutoValue to Yes.

Please add [Solved] to the the start of the title of your first post (use the edit button) if your question has been answered.
 Edit: I think I've missed completely the point of your question. Sorry. Let me think. 
Attachments
Database.png
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Autonumeric column in report

Post by TheGurkha »

Do you want the report to put in the numbers beside the names, incrementing by 1 each time? These are not numbers in the database, they will only appear on the report?

What is your database held in? Base, or a spreadsheet, or another database connected to Base...?
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
mariussiuram
Posts: 3
Joined: Fri Jul 04, 2008 10:29 am

Re: Autonumeric column in report

Post by mariussiuram »

Gurkha, thanks and sorry for my poor english and poor explanation
Do you want the report to put in the numbers beside the names, incrementing by 1 each time? These are not numbers in the database, they will only appear on the report?
exactly, that's what I meant

It's everything inside the same .odb file. There is a "big" table, a small query (with the table) and the report I'm trying to do (uses the query fields).

I hope I explained it well... thanks for your time.
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Autonumeric column in report

Post by TheGurkha »

No worries, just wanted to check that I had it straight.

And you don't need apologise for your English, it always amazes me when non-native English speakers deal with technical matters on forums such as this.

Anyway, let me see what I can turn up.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Autonumeric column in report

Post by TheGurkha »

OK, my palindromic friend, I finally got it worked out.

In case you don't have it: Sun report Builder

Using the Sun Report Builder, open the Navigator and right-click on the Functions item.

1. Select New Function from the menu.
2. An entry titled Funtion appears in the Navigator tree below the main Functions title. Highlight this new entry. In the Properties, rename this to Counter.
3. In the Formula field enter [Counter]+1, including the '[' and ']'. In the initial value field enter 0.
4. Click the Save icon.
5. On the main menu bar click on the Text Box icon, and draw the text box on the report where the counter is to go.
6. Click on the new text box and in the Properties for it click on the Data tab.
7. In the Data Field Type drop down select the name of the new Function you created, Counter.
8. Click the Save icon again.
9. Run your report, you should see the counter incrementing as shown.

Please add [Solved] to the the start of the title of your first post (use the edit button) if your question has been answered.
Attachments
Properties of the new Function called Counter, also shown in the Navigator
Properties of the new Function called Counter, also shown in the Navigator
Properties of the text box referencing the new Counter variable
Properties of the text box referencing the new Counter variable
Text Box Properties.png (11.5 KiB) Viewed 3870 times
Example report with the counter incrementing once per line
Example report with the counter incrementing once per line
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
mariussiuram
Posts: 3
Joined: Fri Jul 04, 2008 10:29 am

Re: Autonumeric column in report

Post by mariussiuram »

That looks great, I'll try it right now.

Thank you very much!
OOo 2.4.X on Ubuntu 8.x + Windows
Post Reply